openapi: 3.0.1
info:
  title: API агентских продаж ЕЭСБО
  version: 1.0.14
  contact:
    name: ЕЭСБО
  description: >-
    API для продажи билетов ЕЭСБО на витрине партнёра: каталог, сеансы, схема мест, заказы, подтверждение оплаты и
    билеты с QR-кодом.


    ## Аутентификация

    1. Получите токен через `POST /api/v1/public/agent/login` по email и паролю учётной записи агента; обновление —
    `POST /api/v1/public/agent/refresh-token`.

    2. Передавайте его в остальных запросах в заголовке `Authorization: Bearer <accessToken>`.


    ## Сквозной процесс

    1. Каталог и карточка: `GET /catalog` → `GET /sales-cards/{salesCardId}` (`versionId`, тарифы).

    2. Для сеанса: `GET /sales-cards/{salesCardId}/sessions` → `GET /sessions/{sessionId}` → `GET
    /sessions/{sessionId}/seating`.

    3. Заказ: `POST /orders` → `seats`, `sectors` или `items` → при необходимости `benefits` и `data` → `validate`.

    4. Оплата на стороне партнёра, затем `POST /orders/{orderId}/confirm` — заказ `PAID`, билеты с `qrToken`.


    ## Срок заказа

    Заказ действует 15 минут с момента создания; изменения срок не продлевают. Без `confirm` заказ становится `EXPIRED`,
    места освобождаются.


    ## Суммы и время

    Суммы — в сумах (UZS), их рассчитывает сервер. Дата и время — местное время Ташкента (UTC+5) без смещения, например
    `2026-12-01T19:00:00`.


    ## Идемпотентность

    Передавайте в `confirm` заголовок `Idempotency-Key`. Повторный `confirm` по тому же заказу не создаёт вторую
    продажу: если заказ уже оплачен, вернутся он и те же билеты.


    ## Ошибки

    Ошибки приходят в формате `ErrorResponse`; ориентируйтесь на HTTP-статус и `code`. `401` с просроченным или неверным
    токеном приходит с пустым телом.


    ## Среды

    Тестовая среда — сервер ниже. Адрес рабочей среды сообщается при подключении.
servers:
  - url: https://dev-api.globalticket.uz/esbo
    description: Тестовая среда
security:
  - bearerAuth: []
tags:
  - name: Авторизация
    description: Вход и обновление токена
  - name: Каталог
    description: Карточки продаж, сеансы и схема мест
  - name: Заказы
    description: Заказ, позиции, льготы, данные посетителей, подтверждение и билеты
paths:
  /api/v1/private/agent/orders/{orderId}/items/{itemId}/benefits:
    put:
      tags:
        - Заказы
      summary: Льготы позиции
      description: "Заменяет льготы позиции целиком: какие и на сколько билетов. Пустой список — сброс"
      operationId: setItemBenefits
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: itemId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KassaOrderBenefitsRequest"
            example:
              benefits:
                - benefitId: 9
                  quantity: 1
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderResponse"
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — место занято, в секторе не хватает мест, карточку или цены обновили, срок заказа истёк, не заполнены
            данные посетителей, сумма заказа 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/data:
    get:
      tags:
        - Заказы
      summary: Дополнительные данные
      description: Поля по каждому билету и сколько заполнено. Пустой список билетов — шаг не нужен
      operationId: data
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderDataResponse"
              example:
                filled: 0
                total: 1
                tickets:
                  - itemId: 1
                    ticketIndex: 1
                    name: VIP
                    visitorType: null
                    sector: Партер
                    row: "3"
                    seat: "10"
                    fields:
                      - fieldId: 4
                        name: Фамилия
                        fieldType: TEXT
                        required: true
                        value: null
                        options: []
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
    put:
      tags:
        - Заказы
      summary: Сохранить дополнительные данные
      description: Пустое значение удаляет сохранённое. У поля с вариантами значение — id варианта
      operationId: saveData
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KassaOrderDataRequest"
            example:
              values:
                - itemId: 1
                  ticketIndex: 1
                  fieldId: 4
                  value: Иванов
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderDataResponse"
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — место занято, в секторе не хватает мест, карточку или цены обновили, срок заказа истёк, не заполнены
            данные посетителей, сумма заказа 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/public/agent/refresh-token:
    post:
      tags:
        - Авторизация
      summary: Обновление токена
      description: Принимает refresh токен и возвращает новую пару access/refresh токенов.
      operationId: refreshToken
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RefreshTokenRequest"
            example:
              refreshToken: eyJhbGciOi...
        required: true
      responses:
        "200":
          description: Токены обновлены
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoginResponse"
        "400":
          description: Некорректный или истёкший refresh токен
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      parameters:
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      security: []
  /api/v1/public/agent/login:
    post:
      tags:
        - Авторизация
      summary: Вход в систему
      description: >-
        Принимает email и пароль технической учётной записи агента и возвращает пару access/refresh токенов. Access
        token передаётся в заголовке Authorization: Bearer <token> при вызове остальных методов.
      operationId: login
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LoginRequest"
            example:
              email: agent@example.com
              password: <пароль>
        required: true
      responses:
        "200":
          description: Успешный вход
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoginResponse"
              example:
                accessToken: eyJhbGciOi...
                refreshToken: eyJhbGciOi...
                expiresIn: 3600
        "400":
          description: Некорректные учётные данные
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              example:
                detail: "[130EECCA1D81] Email обязателен; Пароль обязателен"
                code: "1007"
                path: /esbo/api/v1/public/agent/login
                timestamp: "2026-12-01 12:00:05"
                traceId: 130eecca1d814428bb21d7f8ae6b4757
        "429":
          description: IP заблокирован после неуспешных попыток
      parameters:
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      security: []
  /api/v1/private/agent/orders:
    get:
      tags:
        - Заказы
      summary: Заказы агента
      description: Все заказы текущего агента, свежие сверху
      operationId: list
      parameters:
        - name: page
          in: query
          description: Номер страницы (с единицы)
          required: false
          schema:
            type: integer
            format: int32
            default: 1
        - name: limit
          in: query
          description: Количество элементов на странице (не больше 100)
          required: false
          schema:
            type: integer
            format: int32
            default: 20
        - name: sortBy
          in: query
          description: "Поле сортировки: createdAt (по умолчанию), savedAt, paidAt, status, totalAmount, finalAmount"
          required: false
          schema:
            type: string
        - name: sortOrder
          in: query
          description: "Направление сортировки: asc или desc (по умолчанию)"
          required: false
          schema:
            type: string
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderListResponse"
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
    post:
      tags:
        - Заказы
      summary: Создать заказ
      description: Черновик заказа по карточке продаж; таймер — 15 минут. 409, если карточку успели переопубликовать
      operationId: create
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KassaOrderCreateRequest"
            example:
              salesCardId: 7
              versionId: 70
        required: true
      responses:
        "201":
          description: "Заказ создан: статус DRAFT, срок expiresAt"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderResponse"
              example:
                id: 1234
                salesCardId: 7
                versionId: 70
                status: DRAFT
                expiresAt: "2026-12-01T12:16:00"
                items: []
                totalAmount: 0
                discountAmount: 0
                finalAmount: 0
                requiresData: false
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — место занято, в секторе не хватает мест, карточку или цены обновили, срок заказа истёк, не заполнены
            данные посетителей, сумма заказа 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      parameters:
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
  /api/v1/private/agent/orders/{orderId}/validate:
    post:
      tags:
        - Заказы
      summary: Проверить заказ перед подтверждением
      description: >-
        Заказ не пуст и не истёк, карточка в продаже и не изменилась, тарифы, услуги и льготы на месте и с теми же
        ценами. При расхождении — 409
      operationId: validate
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderResponse"
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — место занято, в секторе не хватает мест, карточку или цены обновили, срок заказа истёк, не заполнены
            данные посетителей, сумма заказа 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/sectors:
    post:
      tags:
        - Заказы
      summary: Добавить билеты в стоячий сектор
      description: Количеством в пределах вместимости. Если мест не хватает — 409
      operationId: addSector
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KassaOrderSectorRequest"
            example:
              sessionId: 50
              sectorKey: 6fa459ea-ee8a-3ca4-894e-db77e160355e
              quantity: 2
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderResponse"
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — место занято, в секторе не хватает мест, карточку или цены обновили, срок заказа истёк, не заполнены
            данные посетителей, сумма заказа 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/seats:
    post:
      tags:
        - Заказы
      summary: Добавить место со схемы зала
      description: Место бронируется за заказом; если его уже взял другой заказ — 409, схему нужно обновить
      operationId: addSeat
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KassaOrderSeatRequest"
            example:
              sessionId: 50
              seatId: seat-parter-3-10
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderResponse"
              example:
                id: 1234
                salesCardId: 7
                versionId: 70
                status: DRAFT
                expiresAt: "2026-12-01T12:16:00"
                items:
                  - id: 1
                    itemType: TARIFF
                    rowId: 3
                    name: VIP
                    visitorType: null
                    color: "#E53935"
                    quantity: 1
                    unitPrice: 300000
                    totalAmount: 300000
                    discountAmount: 0
                    finalAmount: 300000
                    invite: false
                    requiresData: false
                    sessionId: 50
                    sessionStartsAt: "2026-12-01T19:00:00"
                    sessionEndsAt: "2026-12-01T21:00:00"
                    seatId: seat-parter-3-10
                    sector: Партер
                    row: "3"
                    seat: "10"
                    sectorKey: null
                    benefits: []
                totalAmount: 300000
                discountAmount: 0
                finalAmount: 300000
                requiresData: false
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — место занято, в секторе не хватает мест, карточку или цены обновили, срок заказа истёк, не заполнены
            данные посетителей, сумма заказа 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/items:
    post:
      tags:
        - Заказы
      summary: Добавить позицию
      description: Тариф или услуга. Та же позиция без места не дублируется — прибавляется количество
      operationId: addItem
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KassaOrderItemRequest"
            example:
              itemType: TARIFF
              rowId: 12
              quantity: 2
              sessionId: 51
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderResponse"
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — место занято, в секторе не хватает мест, карточку или цены обновили, срок заказа истёк, не заполнены
            данные посетителей, сумма заказа 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/confirm:
    post:
      tags:
        - Заказы
      summary: Подтвердить заказ
      description: >-
        Вызывайте после успешной оплаты на своей стороне. Заказ становится PAID, выпускаются билеты, места — SOLD.
        Повторный вызов по тому же заказу не создаёт вторую продажу: если заказ уже оплачен, вернутся он и те же билеты.
        Заказ на 0 сум через API не подтверждается — 409.
      operationId: confirm
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Idempotency-Key
          in: header
          description: >-
            Строка до 100 символов, например UUID, — своя для каждого подтверждения; при повторе того же подтверждения
            не меняйте
          required: false
          schema:
            type: string
            maxLength: 100
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AgentConfirmRequest"
            example:
              ticketLanguage: RU
              group: false
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaConfirmResponse"
              example:
                order:
                  id: 1234
                  salesCardId: 7
                  versionId: 70
                  status: PAID
                  expiresAt: "2026-12-01T12:16:00"
                  items: []
                  totalAmount: 300000
                  discountAmount: 0
                  finalAmount: 300000
                  requiresData: false
                  paymentType: AGENT
                  ticketLanguage: RU
                  group: false
                tickets:
                  orderId: 1234
                  group: false
                  groupQrToken: null
                  paidAt: "2026-12-01T12:05:00"
                  tickets:
                    - id: 3f2c8a1e-6b1d-4c55-9a51-2e4b7c0d9f10
                      number: "000123"
                      itemId: 1
                      name: VIP
                      visitorType: null
                      sessionId: 50
                      sessionStartsAt: "2026-12-01T19:00:00"
                      sessionEndsAt: "2026-12-01T21:00:00"
                      sector: Партер
                      row: "3"
                      seat: "10"
                      price: 300000
                      benefit: null
                      qrToken: <строка для QR-кода>
                      language: RU
                      status: ACTIVE
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — место занято, в секторе не хватает мест, карточку или цены обновили, срок заказа истёк, не заполнены
            данные посетителей, сумма заказа 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/items/{itemId}:
    delete:
      tags:
        - Заказы
      summary: Удалить позицию
      operationId: deleteItem
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: itemId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderResponse"
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — место занято, в секторе не хватает мест, карточку или цены обновили, срок заказа истёк, не заполнены
            данные посетителей, сумма заказа 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
    patch:
      tags:
        - Заказы
      summary: Изменить количество
      description: Если льгот становится больше, чем билетов, лишние снимаются с последних льгот
      operationId: updateItemQuantity
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: itemId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KassaOrderItemQuantityRequest"
            example:
              quantity: 3
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderResponse"
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — место занято, в секторе не хватает мест, карточку или цены обновили, срок заказа истёк, не заполнены
            данные посетителей, сумма заказа 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/sessions/{sessionId}:
    get:
      tags:
        - Каталог
      summary: Состав сеанса
      description: Тарифы, услуги и льготы сеанса с учётом наследования из карточки. Сеанс, который нельзя продать, — 404
      operationId: session
      parameters:
        - name: sessionId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaSessionSaleResponse"
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/sessions/{sessionId}/seating:
    get:
      tags:
        - Каталог
      summary: Схема зала сеанса
      description: >-
        Тариф, льгота, цена и состояние каждого места и стоячие сектора с остатком. С orderId места этого заказа
        приходят как IN_ORDER, места других заказов — HELD
      operationId: seating
      parameters:
        - name: sessionId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: orderId
          in: query
          description: Текущий заказ агента
          required: false
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaSeatingResponse"
              example:
                sessionId: 50
                sessionVersionId: 501
                configurationId: 12
                tariffs:
                  - tariffRowId: 3
                    name: VIP
                    color: "#E53935"
                    price: 300000
                    seatCount: 120
                    benefits:
                      - benefitId: 9
                        name: Для пенсионеров
                        discountPercent: 30
                        seatCount: 20
                seats:
                  - seatId: seat-parter-3-10
                    sectorKey: 1b4e28ba-2fa1-11d2-883f-0016d3cca427
                    sector: Партер
                    row: "3"
                    seat: "10"
                    tariffRowId: 3
                    benefitId: null
                    price: 300000
                    status: FREE
                sectors:
                  - sectorKey: 6fa459ea-ee8a-3ca4-894e-db77e160355e
                    name: Фан-зона
                    ga: true
                    tariffRowId: 7
                    capacity: 500
                    available: 312
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: >-
            1003 — у сеанса нет схемы мест или сеанс недоступен. Если `GET /sessions/{sessionId}` отвечает 200,
            продавайте количеством через `POST /orders/{orderId}/items`
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/sales-cards/{salesCardId}:
    get:
      tags:
        - Каталог
      summary: Карточка продаж
      description: >-
        Опубликованная версия карточки: тарифы, услуги и льготы с названиями на языке запроса. Карточка, которую агент
        не может продать, — 404
      operationId: salesCard
      parameters:
        - name: salesCardId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaSaleCardResponse"
              example:
                id: 7
                versionId: 70
                name: Симфонический концерт
                category: CONCERT
                saleType: SCHEDULED_SESSION
                venue:
                  id: 3
                  name: Большой зал
                organization:
                  id: 2
                  name: Концертная организация
                tariffs:
                  - id: 3
                    rowType: TARIFF
                    name: VIP
                    price: 300000
                    color: "#E53935"
                    ticketCount: null
                    invite: false
                    requiresData: false
                    children: []
                  - id: 4
                    rowType: TARIFF
                    name: Партер
                    price: null
                    color: "#1E88E5"
                    invite: false
                    requiresData: false
                    children:
                      - id: 81
                        rowType: VISITOR_TYPE
                        name: Взрослый
                        price: 150000
                        children: []
                      - id: 82
                        rowType: VISITOR_TYPE
                        name: Детский
                        price: 80000
                        children: []
                services: []
                benefits:
                  - id: 9
                    name: Для пенсионеров
                    discountPercent: 30
                    color: "#43A047"
                    tariffRowIds:
                      - 3
                      - 81
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              example:
                detail: "[74132A13AB1A] Ресурс не найден."
                code: "1003"
                path: /esbo/api/v1/private/agent/sales-cards/7
                timestamp: "2026-12-01 12:00:10"
                traceId: 74132a13ab1a4e9db473763b11639bf9
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/sales-cards/{salesCardId}/sessions:
    get:
      tags:
        - Каталог
      summary: Сеансы карточки
      description: Продаваемые сеансы по порядку начала. У свободного посещения — пустой список
      operationId: sessions
      parameters:
        - name: salesCardId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: dateFrom
          in: query
          description: Начало периода, включительно
          required: false
          schema:
            type: string
            format: date
        - name: dateTo
          in: query
          description: Конец периода, включительно; без него — один день dateFrom
          required: false
          schema:
            type: string
            format: date
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/KassaSessionResponse"
              example:
                - id: 50
                  versionId: 501
                  startsAt: "2026-12-01T19:00:00"
                  endsAt: "2026-12-01T21:00:00"
                  availableTickets: 412
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}:
    get:
      tags:
        - Заказы
      summary: Заказ по ID
      description: Состав и суммы, посчитанные сервером. Заказ, у которого вышло время, приходит со статусом EXPIRED
      operationId: get
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderResponse"
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
    delete:
      tags:
        - Заказы
      summary: Удалить заказ
      description: Неоплаченный заказ отменяется, места освобождаются
      operationId: delete
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "204":
          description: Заказ удалён, места освобождены
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — место занято, в секторе не хватает мест, карточку или цены обновили, срок заказа истёк, не заполнены
            данные посетителей, сумма заказа 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/tickets:
    get:
      tags:
        - Заказы
      summary: Билеты заказа
      description: Билеты оплаченного заказа с QR
      operationId: tickets
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaTicketsResponse"
              example:
                orderId: 1234
                group: false
                groupQrToken: null
                paidAt: "2026-12-01T12:05:00"
                tickets:
                  - id: 3f2c8a1e-6b1d-4c55-9a51-2e4b7c0d9f10
                    number: "000123"
                    itemId: 1
                    name: VIP
                    visitorType: null
                    sessionId: 50
                    sessionStartsAt: "2026-12-01T19:00:00"
                    sessionEndsAt: "2026-12-01T21:00:00"
                    sector: Партер
                    row: "3"
                    seat: "10"
                    price: 300000
                    benefit: null
                    qrToken: <строка для QR-кода>
                    language: RU
                    status: ACTIVE
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/catalog:
    get:
      tags:
        - Каталог
      summary: Каталог
      description: >-
        Карточки продаж, которые агент может продать сейчас: опубликованные, в продаже, в привязанных к нему
        организациях. Фильтры применяются вместе
      operationId: catalog
      parameters:
        - name: page
          in: query
          description: Номер страницы (с единицы)
          required: false
          schema:
            type: integer
            format: int32
            default: 1
        - name: limit
          in: query
          description: Количество элементов на странице (не больше 100)
          required: false
          schema:
            type: integer
            format: int32
            default: 20
        - name: q
          in: query
          description: Поиск по названию карточки и площадки
          required: false
          schema:
            type: string
        - name: cityIds
          in: query
          description: Города (регионы площадок)
          required: false
          schema:
            type: array
            items:
              type: integer
              format: int64
        - name: organizationTypeIds
          in: query
          description: Типы организаций
          required: false
          schema:
            type: array
            items:
              type: integer
              format: int64
        - name: organizationIds
          in: query
          description: Организации
          required: false
          schema:
            type: array
            items:
              type: integer
              format: int64
        - name: venueIds
          in: query
          description: Площадки
          required: false
          schema:
            type: array
            items:
              type: integer
              format: int64
        - name: categories
          in: query
          description: Категории карточек продаж (SalesCardCategory)
          required: false
          schema:
            type: array
            items:
              type: string
        - name: sort
          in: query
          description: "Сортировка: POPULAR (по умолчанию) или NEAREST"
          required: false
          schema:
            type: string
        - name: dateFrom
          in: query
          description: >-
            Начало периода, включительно. Карточки с сеансами показываются, если в периоде есть продаваемый сеанс;
            свободное посещение — всегда
          required: false
          schema:
            type: string
            format: date
        - name: dateTo
          in: query
          description: Конец периода, включительно; без него — один день dateFrom
          required: false
          schema:
            type: string
            format: date
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaCatalogResponse"
              example:
                items:
                  - id: 7
                    name: Симфонический концерт
                    category: CONCERT
                    saleType: SCHEDULED_SESSION
                    photo:
                      id: 31
                      photoType: HORIZONTAL
                      ru:
                        fileId: 501
                        fileUrl: https://example.com/banner-ru.jpg
                    venue:
                      id: 3
                      name: Большой зал
                    organization:
                      id: 2
                      name: Концертная организация
                    minPrice: 80000
                    nearestSession:
                      startsAt: "2026-12-01T19:00:00"
                      endsAt: "2026-12-01T21:00:00"
                    sessionCount: 4
                totalElements: 1
                page: 1
                size: 20
                totalPages: 1
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/catalog/filters:
    get:
      tags:
        - Каталог
      summary: Значения фильтров каталога
      description: Города, типы организаций, организации, площадки и категории, по которым у агента есть карточки в продаже
      operationId: filters
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaCatalogFiltersResponse"
        "400":
          description: >-
            1006 — запрос не проходит проверку (нет такого места, лишний или пропущенный `sessionId`, неверный `rowId`);
            1007 — неверный формат запроса
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Нет токена (код 1004) или токен просрочен или неверен — во втором случае тело ответа пустое
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: У учётной записи нет права на агентские продажи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — карточка, сеанс или заказ не найдены или недоступны вашей учётной записи
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — сбой на стороне ЕЭСБО
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      parameters:
        - name: Accept-Language
          in: header
          required: false
          description: "Язык названий и текстов ошибок: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
components:
  schemas:
    Benefit:
      required:
        - benefitId
        - quantity
      type: object
      properties:
        benefitId:
          type: integer
          description: ID льготы карточки или сеанса
          format: int64
          example: 9
        quantity:
          maximum: 1000
          minimum: 0
          type: integer
          description: Сколько билетов идут по льготе; 0 — льгота не применяется
          format: int32
          example: 2
      description: Льгота на часть билетов позиции
    KassaOrderBenefitsRequest:
      required:
        - benefits
      type: object
      properties:
        benefits:
          type: array
          description: Льготы и на сколько билетов позиции каждая
          items:
            $ref: "#/components/schemas/Benefit"
      description: "Льготы позиции целиком: заменяют прежние. Пустой список — «Сбросить»"
    Item:
      type: object
      properties:
        id:
          type: integer
          description: ID позиции
          format: int64
        itemType:
          $ref: "#/components/schemas/KassaOrderItemType"
        rowId:
          type: integer
          description: ID листа дерева тарифов или услуг
          format: int64
        itemKey:
          type: string
          description: Ключ строки, общий для всех версий карточки
          format: uuid
        name:
          type: string
          description: Тариф или услуга на языке запроса
        visitorType:
          type: string
          description: Тип посетителя («Взрослый»); null, если его нет
        color:
          type: string
          description: Код цвета тарифа; null у услуг и тарифов без цвета
        quantity:
          type: integer
          description: Количество
          format: int32
        unitPrice:
          type: number
          description: Цена за единицу
        totalAmount:
          type: number
          description: Сумма без скидки
        discountAmount:
          type: number
          description: Скидка по льготам
        finalAmount:
          type: number
          description: Сумма со скидкой
        invite:
          type: boolean
          description: Пригласительный
        requiresData:
          type: boolean
          description: Нужны дополнительные данные
        sessionId:
          type: integer
          description: Сеанс; null у свободного посещения
          format: int64
        sessionStartsAt:
          type: string
          description: Начало сеанса (местное время Ташкента, без смещения)
          example: "2026-12-01T19:00:00"
        sessionEndsAt:
          type: string
          description: Конец сеанса (местное время Ташкента, без смещения)
          example: "2026-12-01T19:00:00"
        seatId:
          type: string
          description: Место схемы; null без схемы посадки
        sector:
          type: string
          description: Сектор места или стоячий сектор («Партер», «Фан-зона»)
        row:
          type: string
          description: Ряд места
        seat:
          type: string
          description: Номер места
        sectorKey:
          type: string
          description: Ключ стоячего сектора; null у мест и без схемы
          format: uuid
        benefits:
          type: array
          description: Льготы позиции
          items:
            $ref: "#/components/schemas/OrderItemBenefit"
      description: Позиция заказа
    KassaOrderItemType:
      type: string
      description: Вид позиции заказа
      enum:
        - TARIFF
        - SERVICE
    KassaOrderResponse:
      type: object
      properties:
        id:
          type: integer
          description: ID заказа
          format: int64
        salesCardId:
          type: integer
          description: ID карточки продаж
          format: int64
        versionId:
          type: integer
          description: Версия карточки, по которой посчитаны цены
          format: int64
        status:
          $ref: "#/components/schemas/KassaOrderStatus"
        expiresAt:
          type: string
          description: "Когда истекает срок заказа: 15 минут с момента создания (местное время Ташкента, без смещения)"
          example: "2026-12-01T19:00:00"
        items:
          type: array
          description: Позиции
          items:
            $ref: "#/components/schemas/Item"
        totalAmount:
          type: number
          description: Всего без скидок
        discountAmount:
          type: number
          description: Скидки по льготам
        finalAmount:
          type: number
          description: Итого к оплате
        requiresData:
          type: boolean
          description: В заказе есть позиции, для которых перед оплатой нужно заполнить данные посетителей
        paymentType:
          $ref: "#/components/schemas/PaymentType"
        ticketLanguage:
          type: string
          description: Язык билета; null, пока не выбран
          enum:
            - RU
            - EN
            - UZ
            - UZ_CYRL
            - KAA
            - KAA_CYRL
        group:
          type: boolean
          description: Групповой билет
      description: Заказ с суммами, посчитанными сервером
    KassaOrderStatus:
      type: string
      enum:
        - DRAFT
        - PAID
        - EXPIRED
      description: DRAFT — собирается; PAID — оплачен; EXPIRED — истёк
    PaymentType:
      type: string
      enum:
        - AGENT
      description: Способ оплаты; после подтверждения — AGENT
    KassaOrderDataRequest:
      required:
        - values
      type: object
      properties:
        values:
          maxItems: 1000
          minItems: 0
          type: array
          description: Значения
          items:
            $ref: "#/components/schemas/Value"
      description: Значения полей данных. Пустое значение удаляет сохранённое
    Value:
      required:
        - fieldId
        - itemId
        - ticketIndex
      type: object
      properties:
        itemId:
          type: integer
          description: ID позиции заказа
          format: int64
        ticketIndex:
          minimum: 1
          type: integer
          description: Какой по счёту билет позиции, с 1
          format: int32
        fieldId:
          type: integer
          description: ID поля справочника
          format: int64
        value:
          maxLength: 500
          minLength: 0
          type: string
          description: Текст или id варианта; пусто — удалить
      description: Значение поля одного билета
    Field:
      type: object
      properties:
        fieldId:
          type: integer
          description: ID поля справочника
          format: int64
        name:
          type: string
          description: Название на языке запроса
        fieldType:
          type: string
          description: Ввод текста или выбор варианта
          enum:
            - TEXT
            - OPTION
        optionPreset:
          type: string
          description: >-
            Готовый набор (страны, регионы) — варианты берутся из системного справочника, значение — id записи
            справочника
          enum:
            - COUNTRIES
            - REGIONS
        options:
          type: array
          description: Собственные варианты поля; значение — id варианта
          items:
            $ref: "#/components/schemas/Option"
        required:
          type: boolean
          description: Обязательное
        value:
          type: string
          description: Сохранённое значение
      description: Поле данных билета
    KassaOrderDataResponse:
      type: object
      properties:
        filled:
          type: integer
          description: Заполнено обязательных полей («Заполнено 3/8»)
          format: int32
        total:
          type: integer
          description: Всего обязательных полей
          format: int32
        tickets:
          type: array
          description: Билеты, для которых нужны данные
          items:
            $ref: "#/components/schemas/Ticket"
      description: "Шаг «Дополнительные данные»: поля по каждому билету и сколько уже заполнено"
    Option:
      type: object
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
      description: Вариант поля
    Ticket:
      type: object
      properties:
        itemId:
          type: integer
          description: ID позиции заказа
          format: int64
        ticketIndex:
          type: integer
          description: Какой по счёту билет позиции, с 1
          format: int32
        name:
          type: string
          description: Тариф или услуга
        visitorType:
          type: string
          description: Тип посетителя
        sector:
          type: string
          description: Сектор места
        row:
          type: string
          description: Ряд
        seat:
          type: string
          description: Место
        fields:
          type: array
          description: Поля
          items:
            $ref: "#/components/schemas/Field"
      description: "Один билет позиции: «Premium (Партер 3/10)»"
    RefreshTokenRequest:
      required:
        - refreshToken
      type: object
      properties:
        refreshToken:
          type: string
          description: Refresh токен
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
      description: Запрос на обновление токена
    LoginResponse:
      type: object
      properties:
        accessToken:
          type: string
          description: Access токен
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
        refreshToken:
          type: string
          description: Refresh токен
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
        expiresIn:
          type: integer
          description: Время жизни токена в секундах
          format: int64
          example: 3600
      description: Ответ на вход в систему
    LoginRequest:
      required:
        - email
        - password
      type: object
      properties:
        email:
          type: string
          description: Email
          example: user@example.com
          format: email
        password:
          minLength: 8
          type: string
          description: Пароль
          example: Qwerty123!
      description: Запрос на вход в систему
    KassaOrderCreateRequest:
      required:
        - salesCardId
        - versionId
      type: object
      properties:
        salesCardId:
          type: integer
          description: ID карточки продаж
          format: int64
          example: 7
        versionId:
          type: integer
          description: >-
            Версия карточки из `GET /sales-cards/{salesCardId}`. Если карточку обновили, заказ не создаётся (409) —
            перечитайте карточку
          format: int64
          example: 70
      description: Новый заказ по карточке продаж
    KassaOrderSectorRequest:
      required:
        - quantity
        - sectorKey
        - sessionId
      type: object
      properties:
        sessionId:
          type: integer
          description: Сеанс
          format: int64
          example: 50
        sectorKey:
          type: string
          description: Ключ стоячего сектора со схемы
          format: uuid
        quantity:
          maximum: 1000
          minimum: 1
          type: integer
          description: Сколько билетов
          format: int32
          example: 2
        rowId:
          type: integer
          description: Тип посетителя под тарифом сектора — только если у тарифа есть типы посетителей
          format: int64
      description: "Билеты в стоячий сектор (фан-зону): количеством, без мест"
    KassaOrderSeatRequest:
      required:
        - seatId
        - sessionId
      type: object
      properties:
        sessionId:
          type: integer
          description: Сеанс
          format: int64
          example: 50
        seatId:
          maxLength: 100
          minLength: 1
          type: string
          description: ID места из `seats[]` схемы мест
          example: seat-parter-3-10
        rowId:
          type: integer
          description: >-
            Тип посетителя под тарифом места — только если у тарифа места есть типы посетителей со своими ценами; иначе
            не передаётся
          format: int64
          example: 81
      description: Место на схеме зала, которое добавляют в заказ
    KassaOrderItemRequest:
      required:
        - itemType
        - quantity
        - rowId
      type: object
      properties:
        itemType:
          $ref: "#/components/schemas/KassaOrderItemType"
        rowId:
          type: integer
          description: ID листа дерева тарифов или услуг
          format: int64
          example: 3
        quantity:
          maximum: 1000
          minimum: 1
          type: integer
          description: Количество. Если такая позиция уже в заказе, количество прибавляется
          format: int32
          example: 1
        sessionId:
          type: integer
          description: >-
            Сеанс — обязателен у карточки с сеансами, пуст у свободного посещения. Тариф и услугу берут из состава этого
            сеанса (GET /api/v1/private/agent/sessions/{sessionId})
          format: int64
          example: 50
      description: Позиция, которую добавляют в заказ
    AgentConfirmRequest:
      required:
        - ticketLanguage
      type: object
      properties:
        ticketLanguage:
          type: string
          description: "Язык билета: RU, UZ, UZ_CYRL, EN, KAA"
          enum:
            - RU
            - UZ
            - UZ_CYRL
            - EN
            - KAA
        group:
          type: boolean
          description: true — один общий QR-код на весь заказ; false — свой QR-код у каждого билета
      description: "Подтверждение заказа агентом: оплата прошла на стороне агента"
    KassaConfirmResponse:
      type: object
      properties:
        order:
          $ref: "#/components/schemas/KassaOrderResponse"
        tickets:
          $ref: "#/components/schemas/KassaTicketsResponse"
      description: "Результат подтверждения: заказ и билеты"
    KassaTicketsResponse:
      type: object
      properties:
        orderId:
          type: integer
          description: ID заказа
          format: int64
        group:
          type: boolean
          description: true — один общий QR-код на весь заказ
        groupQrToken:
          type: string
          description: "Общий QR-код заказа при `group: true`; при `group: false` — null"
        paidAt:
          type: string
          description: Когда оплачен (местное время Ташкента, без смещения)
          example: "2026-12-01T19:00:00"
        tickets:
          type: array
          description: Билеты
          items:
            $ref: "#/components/schemas/AgentTicket"
      description: Билеты оплаченного заказа
    KassaOrderItemQuantityRequest:
      required:
        - quantity
      type: object
      properties:
        quantity:
          maximum: 1000
          minimum: 1
          type: integer
          description: Количество
          format: int32
          example: 2
      description: Новое количество позиции; чтобы убрать позицию, её удаляют
    KassaBenefitResponse:
      type: object
      properties:
        id:
          type: integer
          description: ID строки льготы версии карточки
          format: int64
        itemKey:
          type: string
          description: Ключ строки, общий для всех версий карточки
          format: uuid
        name:
          type: string
          description: Публичное название на языке запроса
        discountPercent:
          type: number
          description: Скидка, %
        color:
          type: string
          description: Цвет льготы на схеме посадки
        tariffRowIds:
          type: array
          description: ID строк TARIFF, к которым применима льгота (вместе с их типами посетителей)
          items:
            type: integer
            description: ID строк TARIFF, к которым применима льгота (вместе с их типами посетителей)
            format: int64
      description: Льгота карточки продаж
    KassaServiceNode:
      type: object
      properties:
        id:
          type: integer
          description: ID строки версии карточки
          format: int64
        itemKey:
          type: string
          description: Ключ строки, общий для всех версий карточки
          format: uuid
        rowType:
          type: string
          description: Уровень строки
          enum:
            - GROUP
            - SERVICE
            - VISITOR_TYPE
        name:
          type: string
          description: Публичное название на языке запроса
        description:
          type: string
          description: Публичное описание на языке запроса
        price:
          type: number
          description: Цена; заполнена только у листьев
        requiresData:
          type: boolean
          description: Перед оплатой нужно заполнить дополнительные данные
        children:
          type: array
          description: Вложенные строки
          items:
            $ref: "#/components/schemas/KassaServiceNode"
      description: "Строка дерева услуг: группа → услуга → тип посетителя. Продаются только листья"
    KassaSessionSaleResponse:
      type: object
      properties:
        id:
          type: integer
          description: ID сеанса
          format: int64
        versionId:
          type: integer
          description: Версия сеанса, по которой посчитан состав; передавать не нужно
          format: int64
        salesCardId:
          type: integer
          description: ID карточки продаж
          format: int64
        startsAt:
          type: string
          description: Начало (местное время Ташкента, без смещения)
          example: "2026-12-01T19:00:00"
        endsAt:
          type: string
          description: Конец (местное время Ташкента, без смещения)
          example: "2026-12-01T19:00:00"
        tariffs:
          type: array
          description: Дерево тарифов сеанса
          items:
            $ref: "#/components/schemas/KassaTariffNode"
        services:
          type: array
          description: Дерево услуг сеанса
          items:
            $ref: "#/components/schemas/KassaServiceNode"
        benefits:
          type: array
          description: Льготы сеанса
          items:
            $ref: "#/components/schemas/KassaBenefitResponse"
      description: "Что продаётся на сеанс: тарифы, услуги и льготы с учётом наследования из карточки"
    KassaTariffNode:
      type: object
      properties:
        id:
          type: integer
          description: ID строки версии карточки
          format: int64
        itemKey:
          type: string
          description: Ключ строки, общий для всех версий карточки
          format: uuid
        rowType:
          type: string
          description: Уровень строки
          enum:
            - GROUP
            - TARIFF
            - VISITOR_TYPE
        name:
          type: string
          description: Публичное название на языке запроса
        description:
          type: string
          description: Публичное описание на языке запроса
        price:
          type: number
          description: Цена; заполнена только у листьев дерева — только их можно добавить в заказ
        color:
          type: string
          description: Цвет тарифа на схеме посадки
        ticketCount:
          type: integer
          description: Количество билетов, если вместимость ограничена
          format: int32
        invite:
          type: boolean
          description: "Пригласительный тариф: оформляется отдельным заказом"
        requiresData:
          type: boolean
          description: Перед оплатой нужно заполнить дополнительные данные
        children:
          type: array
          description: Вложенные строки
          items:
            $ref: "#/components/schemas/KassaTariffNode"
      description: "Строка дерева тарифов: группа → тариф → тип посетителя. Продаются только листья"
    KassaSeatStatus:
      type: string
      description: Состояние места на схеме зала
      enum:
        - FREE
        - IN_ORDER
        - HELD
        - SOLD
        - UNAVAILABLE
    KassaSeatingResponse:
      type: object
      properties:
        sessionId:
          type: integer
          description: ID сеанса
          format: int64
        sessionVersionId:
          type: integer
          description: Версия сеанса, по которой размечена схема
          format: int64
        configurationId:
          type: integer
          description: "Служебное поле: конфигурация зала"
          format: int64
        tariffs:
          type: array
          description: "Легенда «Тарифы»: тарифы схемы с числом мест и льготами"
          items:
            $ref: "#/components/schemas/Tariff"
        seats:
          type: array
          description: Места конфигурации
          items:
            $ref: "#/components/schemas/Seat"
        sectors:
          type: array
          description: Сектора конфигурации; у стоячих — вместимость и остаток
          items:
            $ref: "#/components/schemas/Sector"
      description: "Схема мест сеанса: тарифы, места и секторы со статусами"
    Seat:
      type: object
      properties:
        seatId:
          type: string
          description: ID места
        sectorKey:
          type: string
          description: Сектор, к которому относится место
          format: uuid
        sector:
          type: string
          description: Сектор на языке запроса («Партер»)
        row:
          type: string
          description: Ряд
        seat:
          type: string
          description: Место
        tariffRowId:
          type: integer
          description: ID строки TARIFF; null — место не продаётся
          format: int64
        benefitId:
          type: integer
          description: ID льготы, размеченной на месте; null — льготы нет
          format: int64
        price:
          type: number
          description: Цена по тарифу без льготы; null, если у тарифа типы посетителей
        status:
          $ref: "#/components/schemas/KassaSeatStatus"
      description: Место
    Sector:
      type: object
      properties:
        sectorKey:
          type: string
          description: Ключ сектора
          format: uuid
        name:
          type: string
          description: Название на языке запроса
        ga:
          type: boolean
          description: "Стоячий сектор (фан-зона): билеты продаются количеством, без мест"
        tariffRowId:
          type: integer
          description: Тариф стоячего сектора; null у сидячего и у неразмеченного
          format: int64
        capacity:
          type: integer
          description: Вместимость стоячего сектора
          format: int32
        available:
          type: integer
          description: Сколько билетов в стоячий сектор ещё можно продать
          format: int32
      description: "Сектор схемы: для двухуровневой схемы — первый уровень"
    Tariff:
      type: object
      properties:
        tariffRowId:
          type: integer
          description: ID строки TARIFF
          format: int64
        name:
          type: string
          description: Название на языке запроса
        description:
          type: string
          description: Описание на языке запроса
        color:
          type: string
          description: Цвет на схеме
        price:
          type: number
          description: Цена; null, если у тарифа типы посетителей со своими ценами
        invite:
          type: boolean
          description: Пригласительный
        seatCount:
          type: integer
          description: Мест по тарифу, включая вместимость стоячих секторов; без снятых с продажи
          format: int32
        benefits:
          type: array
          description: Льготы на местах этого тарифа
          items:
            $ref: "#/components/schemas/TariffBenefit"
      description: Тариф схемы
    TariffBenefit:
      type: object
      properties:
        benefitId:
          type: integer
          format: int64
        name:
          type: string
        color:
          type: string
        discountPercent:
          type: number
        seatCount:
          type: integer
          format: int32
      description: "Льгота на местах тарифа: «Для пенсионеров − 30% • 100 мест»"
    KassaReference:
      type: object
      properties:
        id:
          type: integer
          description: ID
          format: int64
        name:
          type: string
          description: Название
      description: "Ссылка на объект: id и название на языке запроса"
    KassaSaleCardResponse:
      type: object
      properties:
        id:
          type: integer
          description: ID карточки продаж
          format: int64
        versionId:
          type: integer
          description: ID версии, по которой продаём; её же передают при создании заказа
          format: int64
        name:
          type: string
          description: Название на языке запроса
        category:
          type: string
          description: Категория
          enum:
            - MUSEUM_VISIT
            - CONCERT
            - THEATER
            - CINEMA
            - EXHIBITION
            - EXCURSION
            - CULTURAL_EVENT
            - SPORT_EVENT
            - SHOW
            - CONFERENCE
            - EDUCATIONAL
            - OTHER
        saleType:
          type: string
          description: "Тип продажи: свободное посещение или сеансы"
          enum:
            - FREE_VISIT
            - SCHEDULED_SESSION
        photo:
          $ref: "#/components/schemas/SalesCardPhotoResponse"
        venue:
          $ref: "#/components/schemas/KassaReference"
        organization:
          $ref: "#/components/schemas/KassaReference"
        tariffs:
          type: array
          description: Дерево тарифов
          items:
            $ref: "#/components/schemas/KassaTariffNode"
        services:
          type: array
          description: Дерево услуг
          items:
            $ref: "#/components/schemas/KassaServiceNode"
        benefits:
          type: array
          description: Льготы
          items:
            $ref: "#/components/schemas/KassaBenefitResponse"
      description: "Карточка продаж: текущая опубликованная версия"
    SalesCardPhotoFile:
      type: object
      properties:
        fileId:
          type: integer
          description: ID файла из модуля файлов
          format: int64
          example: 42
        fileUrl:
          maxLength: 1000
          minLength: 0
          type: string
          description: Ссылка на файл баннера
      description: Загруженный файл баннера на одном языке
    SalesCardPhotoResponse:
      type: object
      properties:
        id:
          type: integer
          description: ID строки баннера
          format: int64
        photoType:
          type: string
          description: Размер баннера
          enum:
            - WIDE
            - HORIZONTAL
            - SQUARE
            - VERTICAL
        ru:
          $ref: "#/components/schemas/SalesCardPhotoFile"
        uz:
          $ref: "#/components/schemas/SalesCardPhotoFile"
        uzCyrl:
          $ref: "#/components/schemas/SalesCardPhotoFile"
        en:
          $ref: "#/components/schemas/SalesCardPhotoFile"
        kaa:
          $ref: "#/components/schemas/SalesCardPhotoFile"
      description: Баннер одного размера с файлом на каждый язык
    KassaSessionResponse:
      type: object
      properties:
        id:
          type: integer
          description: ID сеанса
          format: int64
        versionId:
          type: integer
          description: Версия сеанса, по которой сейчас продают
          format: int64
        startsAt:
          type: string
          description: Начало (местное время Ташкента, без смещения)
          example: "2026-12-01T19:00:00"
        endsAt:
          type: string
          description: Конец (местное время Ташкента, без смещения)
          example: "2026-12-01T19:00:00"
        availableTickets:
          type: integer
          description: >-
            Сколько билетов ещё можно продать (бейдж у сеанса); null — без ограничения: у сеанса нет схемы и вместимость
            тарифов не задана
          format: int32
      description: Сеанс карточки
    KassaOrderListResponse:
      type: object
      properties:
        items:
          type: array
          description: Заказы — тот же состав, что у заказа по ID
          items:
            $ref: "#/components/schemas/KassaOrderResponse"
        totalElements:
          type: integer
          description: Всего элементов
          format: int64
        page:
          type: integer
          description: Номер текущей страницы
          format: int32
        size:
          type: integer
          description: Размер страницы
          format: int32
        totalPages:
          type: integer
          description: Всего страниц
          format: int32
      description: Страница заказов агента
    KassaCatalogItemResponse:
      type: object
      properties:
        id:
          type: integer
          description: ID карточки продаж
          format: int64
        name:
          type: string
          description: Название на языке запроса
        category:
          type: string
          description: Категория
          enum:
            - MUSEUM_VISIT
            - CONCERT
            - THEATER
            - CINEMA
            - EXHIBITION
            - EXCURSION
            - CULTURAL_EVENT
            - SPORT_EVENT
            - SHOW
            - CONFERENCE
            - EDUCATIONAL
            - OTHER
        saleType:
          type: string
          description: "Тип продажи: свободное посещение или сеансы"
          enum:
            - FREE_VISIT
            - SCHEDULED_SESSION
        photo:
          $ref: "#/components/schemas/SalesCardPhotoResponse"
        venue:
          $ref: "#/components/schemas/KassaReference"
        organization:
          $ref: "#/components/schemas/KassaReference"
        minPrice:
          type: number
          description: >-
            Минимальная ненулевая цена тарифа («от N UZS»); у карточки с сеансами — по продаваемым сеансам выбранного
            периода; null, если тарифов нет
        nearestSession:
          $ref: "#/components/schemas/KassaSessionTime"
        sessionCount:
          type: integer
          description: Сколько всего продаваемых сеансов в выбранном периоде; «+N» на карточке — это sessionCount − 1
          format: int32
      description: Карточка продаж в каталоге
    KassaCatalogResponse:
      type: object
      properties:
        items:
          type: array
          description: Карточки продаж
          items:
            $ref: "#/components/schemas/KassaCatalogItemResponse"
        totalElements:
          type: integer
          description: Всего элементов
          format: int64
        page:
          type: integer
          description: Номер текущей страницы
          format: int32
        size:
          type: integer
          description: Размер страницы
          format: int32
        totalPages:
          type: integer
          description: Всего страниц
          format: int32
      description: Страница каталога
    KassaSessionTime:
      type: object
      properties:
        startsAt:
          type: string
          description: Начало (местное время Ташкента, без смещения)
          example: "2026-12-01T19:00:00"
        endsAt:
          type: string
          description: Конец (местное время Ташкента, без смещения)
          example: "2026-12-01T19:00:00"
      description: Время сеанса
    KassaCatalogFiltersResponse:
      type: object
      properties:
        cities:
          type: array
          description: Города (регионы площадок)
          items:
            $ref: "#/components/schemas/KassaReference"
        organizationTypes:
          type: array
          description: Типы организаций
          items:
            $ref: "#/components/schemas/KassaReference"
        organizations:
          type: array
          description: Организации
          items:
            $ref: "#/components/schemas/KassaReference"
        venues:
          type: array
          description: Площадки
          items:
            $ref: "#/components/schemas/KassaReference"
        categories:
          type: array
          description: Категории карточек продаж
          items:
            type: string
            description: Категории карточек продаж
            enum:
              - MUSEUM_VISIT
              - CONCERT
              - THEATER
              - CINEMA
              - EXHIBITION
              - EXCURSION
              - CULTURAL_EVENT
              - SPORT_EVENT
              - SHOW
              - CONFERENCE
              - EDUCATIONAL
              - OTHER
      description: "Значения фильтров каталога: только те, по которым у агента есть карточки в продаже"
    ErrorResponse:
      type: object
      description: Тело ответа с ошибкой
      properties:
        detail:
          type: string
          description: >-
            Текст ошибки на языке из `Accept-Language`; начинается с короткого идентификатора запроса в квадратных
            скобках
        code:
          type: string
          description: "Код ошибки: 1001, 1003, 1004, 1006, 1007, 1008"
        path:
          type: string
          description: Путь запроса на сервере
        timestamp:
          type: string
          description: Время ответа
          example: "2026-12-01 12:01:05"
        traceId:
          type: string
          description: Идентификатор запроса — указывайте его при обращении в поддержку
      example:
        detail: "[74132A13AB1A] Ресурс не найден."
        code: "1003"
        path: /esbo/api/v1/private/agent/sales-cards/7
        timestamp: "2026-12-01 12:00:10"
        traceId: 74132a13ab1a4e9db473763b11639bf9
    AgentTicket:
      type: object
      description: Билет
      properties:
        id:
          type: string
          format: uuid
          description: ID билета
        number:
          type: string
          description: Номер билета
        itemId:
          type: integer
          format: int64
          description: ID позиции заказа
        name:
          type: string
          description: Название тарифа или услуги
        visitorType:
          type: string
          nullable: true
          description: Тип посетителя
        sessionId:
          type: integer
          format: int64
          nullable: true
          description: Сеанс; у свободного посещения — null
        sessionStartsAt:
          type: string
          description: Начало сеанса (местное время Ташкента)
          example: "2026-12-01T19:00:00"
          nullable: true
        sessionEndsAt:
          type: string
          description: Окончание сеанса (местное время Ташкента)
          example: "2026-12-01T19:00:00"
          nullable: true
        sector:
          type: string
          nullable: true
          description: Сектор; у билета без места — null
        row:
          type: string
          nullable: true
          description: Ряд; у билета без места — null
        seat:
          type: string
          nullable: true
          description: Место; у билета без места — null
        price:
          type: number
          description: Цена билета, сум
        benefit:
          type: string
          nullable: true
          description: Льгота, если применена
        qrToken:
          type: string
          description: Строка, которую кодируют в QR-код билета. Передавайте только покупателю
        language:
          type: string
          enum:
            - RU
            - UZ
            - UZ_CYRL
            - EN
            - KAA
          description: Язык билета
        status:
          type: string
          enum:
            - ACTIVE
          description: Статус билета
    OrderItemBenefit:
      type: object
      description: Льгота на часть билетов позиции
      properties:
        benefitId:
          type: integer
          format: int64
          description: ID льготы
        name:
          type: string
          description: Название на языке запроса
        color:
          type: string
          description: Код цвета льготы
        discountPercent:
          type: number
          description: Скидка, %
        quantity:
          type: integer
          format: int32
          description: Сколько билетов по льготе
        discountAmount:
          type: number
          description: Сумма скидки
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: accessToken из `POST /api/v1/public/agent/login`
