openapi: 3.0.1
info:
  title: ESBO Agent Sales API
  version: 1.0.14
  contact:
    name: ESBO
  description: >-
    API for selling ESBO tickets on the partner's storefront: catalog, sessions, seating map, orders, payment
    confirmation and tickets with a QR code.


    ## Authentication

    1. Get a token via `POST /api/v1/public/agent/login` with the agent account email and password; refresh it via `POST
    /api/v1/public/agent/refresh-token`.

    2. Pass it in all other requests in the `Authorization: Bearer <accessToken>` header.


    ## End-to-end flow

    1. Catalog and card: `GET /catalog` → `GET /sales-cards/{salesCardId}` (`versionId`, tariffs).

    2. For a session: `GET /sales-cards/{salesCardId}/sessions` → `GET /sessions/{sessionId}` → `GET
    /sessions/{sessionId}/seating`.

    3. Order: `POST /orders` → `seats`, `sectors` or `items` → `benefits` and `data` if needed → `validate`.

    4. Payment on the partner side, then `POST /orders/{orderId}/confirm` — the order is `PAID`, tickets with `qrToken`.


    ## Order lifetime

    An order is valid for 15 minutes from creation; changes do not extend it. Without `confirm` the order becomes
    `EXPIRED` and the seats are released.


    ## Amounts and time

    Amounts are in sums (UZS) and are calculated by the server. Date and time are Tashkent local time (UTC+5) without an
    offset, for example `2026-12-01T19:00:00`.


    ## Idempotency

    Pass the `Idempotency-Key` header in `confirm`. A repeated `confirm` for the same order does not create a second
    sale: if the order is already paid, it is returned with the same tickets.


    ## Errors

    Errors are returned in the `ErrorResponse` format; rely on the HTTP status and `code`. A `401` for an expired or
    invalid token comes with an empty body.


    ## Environments

    The test environment is the server below. The production environment URL is provided at onboarding.
servers:
  - url: https://dev-api.globalticket.uz/esbo
    description: Test environment
security:
  - bearerAuth: []
tags:
  - name: Authorization
    description: Login and token refresh
  - name: Catalog
    description: Sales cards, sessions and seating map
  - name: Orders
    description: Order, order items, benefits, visitor data, confirmation and tickets
paths:
  /api/v1/private/agent/orders/{orderId}/items/{itemId}/benefits:
    put:
      tags:
        - Orders
      summary: Order item benefits
      description: "Fully replaces the order item's benefits: which ones and for how many tickets. An empty list resets them"
      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: "Language of names and error texts: 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 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — the seat is taken, not enough places in the sector, the card or prices were updated, the order
            lifetime expired, visitor data is not filled, the order amount is 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/data:
    get:
      tags:
        - Orders
      summary: Additional data
      description: Fields for each ticket and how many are filled. An empty ticket list means the step is not needed
      operationId: data
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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: Stalls
                    row: "3"
                    seat: "10"
                    fields:
                      - fieldId: 4
                        name: Last name
                        fieldType: TEXT
                        required: true
                        value: null
                        options: []
        "400":
          description: >-
            1006 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
    put:
      tags:
        - Orders
      summary: Save additional data
      description: An empty value deletes the saved one. For a field with options, the value is the option id
      operationId: saveData
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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: Smith
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaOrderDataResponse"
        "400":
          description: >-
            1006 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — the seat is taken, not enough places in the sector, the card or prices were updated, the order
            lifetime expired, visitor data is not filled, the order amount is 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/public/agent/refresh-token:
    post:
      tags:
        - Authorization
      summary: Token refresh
      description: Takes a refresh token and returns a new access/refresh token pair.
      operationId: refreshToken
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RefreshTokenRequest"
            example:
              refreshToken: eyJhbGciOi...
        required: true
      responses:
        "200":
          description: Tokens refreshed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoginResponse"
        "400":
          description: Invalid or expired refresh token
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      parameters:
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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:
        - Authorization
      summary: Log in
      description: >-
        Takes the email and password of the agent's service account and returns an access/refresh token pair. The access
        token is passed in the Authorization: Bearer <token> header when calling the other methods.
      operationId: login
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LoginRequest"
            example:
              email: agent@example.com
              password: <password>
        required: true
      responses:
        "200":
          description: Successful login
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoginResponse"
              example:
                accessToken: eyJhbGciOi...
                refreshToken: eyJhbGciOi...
                expiresIn: 3600
        "400":
          description: Invalid credentials
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              example:
                detail: "[130EECCA1D81] Email is required; Password is required"
                code: "1007"
                path: /esbo/api/v1/public/agent/login
                timestamp: "2026-12-01 12:00:05"
                traceId: 130eecca1d814428bb21d7f8ae6b4757
        "429":
          description: IP blocked after failed attempts
      parameters:
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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:
        - Orders
      summary: Agent orders
      description: All orders of the current agent, newest first
      operationId: list
      parameters:
        - name: page
          in: query
          description: Page number (starting at one)
          required: false
          schema:
            type: integer
            format: int32
            default: 1
        - name: limit
          in: query
          description: Number of items per page (no more than 100)
          required: false
          schema:
            type: integer
            format: int32
            default: 20
        - name: sortBy
          in: query
          description: "Sort field: createdAt (default), savedAt, paidAt, status, totalAmount, finalAmount"
          required: false
          schema:
            type: string
        - name: sortOrder
          in: query
          description: "Sort direction: asc or desc (default)"
          required: false
          schema:
            type: string
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
    post:
      tags:
        - Orders
      summary: Create order
      description: Order draft for a sales card; timer — 15 minutes. 409 if the card has been republished in the meantime
      operationId: create
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KassaOrderCreateRequest"
            example:
              salesCardId: 7
              versionId: 70
        required: true
      responses:
        "201":
          description: "Order created: status DRAFT, expires at 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 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — the seat is taken, not enough places in the sector, the card or prices were updated, the order
            lifetime expired, visitor data is not filled, the order amount is 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      parameters:
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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:
        - Orders
      summary: Validate the order before confirmation
      description: >-
        The order is not empty and has not expired, the card is on sale and unchanged, tariffs, services and benefits
        are in place with the same prices. On a mismatch — 409
      operationId: validate
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — the seat is taken, not enough places in the sector, the card or prices were updated, the order
            lifetime expired, visitor data is not filled, the order amount is 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/sectors:
    post:
      tags:
        - Orders
      summary: Add standing sector tickets
      description: By quantity within capacity. If there are not enough places — 409
      operationId: addSector
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — the seat is taken, not enough places in the sector, the card or prices were updated, the order
            lifetime expired, visitor data is not filled, the order amount is 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/seats:
    post:
      tags:
        - Orders
      summary: Add a seat from the hall map
      description: The seat is held for the order; if another order has already taken it — 409, the map needs to be refreshed
      operationId: addSeat
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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: Stalls
                    row: "3"
                    seat: "10"
                    sectorKey: null
                    benefits: []
                totalAmount: 300000
                discountAmount: 0
                finalAmount: 300000
                requiresData: false
        "400":
          description: >-
            1006 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — the seat is taken, not enough places in the sector, the card or prices were updated, the order
            lifetime expired, visitor data is not filled, the order amount is 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/items:
    post:
      tags:
        - Orders
      summary: Add an order item
      description: Tariff or service. The same order item without a seat is not duplicated — the quantity is added
      operationId: addItem
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — the seat is taken, not enough places in the sector, the card or prices were updated, the order
            lifetime expired, visitor data is not filled, the order amount is 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/confirm:
    post:
      tags:
        - Orders
      summary: Confirm order
      description: >-
        Call after a successful payment on your side. The order becomes PAID, tickets are issued, seats become SOLD. A
        repeated call for the same order does not create a second sale: if the order is already paid, it is returned
        with the same tickets. An order for 0 sum cannot be confirmed through the API — 409.
      operationId: confirm
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Idempotency-Key
          in: header
          description: >-
            A string of up to 100 characters, for example a UUID — unique for each confirmation; do not change it when
            retrying the same confirmation
          required: false
          schema:
            type: string
            maxLength: 100
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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: Stalls
                      row: "3"
                      seat: "10"
                      price: 300000
                      benefit: null
                      qrToken: <QR code string>
                      language: RU
                      status: ACTIVE
        "400":
          description: >-
            1006 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — the seat is taken, not enough places in the sector, the card or prices were updated, the order
            lifetime expired, visitor data is not filled, the order amount is 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/items/{itemId}:
    delete:
      tags:
        - Orders
      summary: Delete order item
      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: "Language of names and error texts: 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 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — the seat is taken, not enough places in the sector, the card or prices were updated, the order
            lifetime expired, visitor data is not filled, the order amount is 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
    patch:
      tags:
        - Orders
      summary: Change quantity
      description: If there are more benefits than tickets, the excess is removed from the last benefits
      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: "Language of names and error texts: 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 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — the seat is taken, not enough places in the sector, the card or prices were updated, the order
            lifetime expired, visitor data is not filled, the order amount is 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/sessions/{sessionId}:
    get:
      tags:
        - Catalog
      summary: Session contents
      description: >-
        Session tariffs, services and benefits, including those inherited from the card. A session that cannot be sold —
        404
      operationId: session
      parameters:
        - name: sessionId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/sessions/{sessionId}/seating:
    get:
      tags:
        - Catalog
      summary: Session hall map
      description: >-
        Tariff, benefit, price and state of each seat, plus standing sectors with the remainder. With orderId, seats of
        this order come as IN_ORDER, seats of other orders as HELD
      operationId: seating
      parameters:
        - name: sessionId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: orderId
          in: query
          description: Current agent order
          required: false
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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: Seniors
                        discountPercent: 30
                        seatCount: 20
                seats:
                  - seatId: seat-parter-3-10
                    sectorKey: 1b4e28ba-2fa1-11d2-883f-0016d3cca427
                    sector: Stalls
                    row: "3"
                    seat: "10"
                    tariffRowId: 3
                    benefitId: null
                    price: 300000
                    status: FREE
                sectors:
                  - sectorKey: 6fa459ea-ee8a-3ca4-894e-db77e160355e
                    name: Fan zone
                    ga: true
                    tariffRowId: 7
                    capacity: 500
                    available: 312
        "400":
          description: >-
            1006 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: >-
            1003 — the session has no seating map or the session is not available. If `GET /sessions/{sessionId}`
            returns 200, sell by quantity via `POST /orders/{orderId}/items`
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/sales-cards/{salesCardId}:
    get:
      tags:
        - Catalog
      summary: Sales card
      description: >-
        Published card version: tariffs, services and benefits with names in the request language. A card the agent
        cannot sell — 404
      operationId: salesCard
      parameters:
        - name: salesCardId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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: Symphony concert
                category: CONCERT
                saleType: SCHEDULED_SESSION
                venue:
                  id: 3
                  name: Grand Hall
                organization:
                  id: 2
                  name: Concert organization
                tariffs:
                  - id: 3
                    rowType: TARIFF
                    name: VIP
                    price: 300000
                    color: "#E53935"
                    ticketCount: null
                    invite: false
                    requiresData: false
                    children: []
                  - id: 4
                    rowType: TARIFF
                    name: Stalls
                    price: null
                    color: "#1E88E5"
                    invite: false
                    requiresData: false
                    children:
                      - id: 81
                        rowType: VISITOR_TYPE
                        name: Adult
                        price: 150000
                        children: []
                      - id: 82
                        rowType: VISITOR_TYPE
                        name: Child
                        price: 80000
                        children: []
                services: []
                benefits:
                  - id: 9
                    name: Seniors
                    discountPercent: 30
                    color: "#43A047"
                    tariffRowIds:
                      - 3
                      - 81
        "400":
          description: >-
            1006 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              example:
                detail: "[74132A13AB1A] Resource not found."
                code: "1003"
                path: /esbo/api/v1/private/agent/sales-cards/7
                timestamp: "2026-12-01 12:00:10"
                traceId: 74132a13ab1a4e9db473763b11639bf9
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/sales-cards/{salesCardId}/sessions:
    get:
      tags:
        - Catalog
      summary: Card sessions
      description: Sessions on sale in order of start time. Empty list for a free visit
      operationId: sessions
      parameters:
        - name: salesCardId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: dateFrom
          in: query
          description: Start of the period, inclusive
          required: false
          schema:
            type: string
            format: date
        - name: dateTo
          in: query
          description: End of the period, inclusive; without it — the single day dateFrom
          required: false
          schema:
            type: string
            format: date
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}:
    get:
      tags:
        - Orders
      summary: Order by ID
      description: Contents and amounts calculated by the server. An order whose time has run out comes with the EXPIRED status
      operationId: get
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
    delete:
      tags:
        - Orders
      summary: Delete order
      description: The unpaid order is cancelled, seats are released
      operationId: delete
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: ru, uz, uz-Cyrl, en, kaa"
          schema:
            type: string
            enum:
              - ru
              - uz
              - uz-Cyrl
              - en
              - kaa
            default: ru
      responses:
        "204":
          description: Order deleted, seats released
        "400":
          description: >-
            1006 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: >-
            1008 — the seat is taken, not enough places in the sector, the card or prices were updated, the order
            lifetime expired, visitor data is not filled, the order amount is 0
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/orders/{orderId}/tickets:
    get:
      tags:
        - Orders
      summary: Order tickets
      description: Tickets of a paid order with QR
      operationId: tickets
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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: Stalls
                    row: "3"
                    seat: "10"
                    price: 300000
                    benefit: null
                    qrToken: <QR code string>
                    language: RU
                    status: ACTIVE
        "400":
          description: >-
            1006 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/catalog:
    get:
      tags:
        - Catalog
      summary: Catalog
      description: >-
        Sales cards the agent can sell now: published, on sale, in the organizations linked to the agent. Filters are
        combined
      operationId: catalog
      parameters:
        - name: page
          in: query
          description: Page number (starting at one)
          required: false
          schema:
            type: integer
            format: int32
            default: 1
        - name: limit
          in: query
          description: Number of items per page (no more than 100)
          required: false
          schema:
            type: integer
            format: int32
            default: 20
        - name: q
          in: query
          description: Search by card name and venue name
          required: false
          schema:
            type: string
        - name: cityIds
          in: query
          description: Cities (venue regions)
          required: false
          schema:
            type: array
            items:
              type: integer
              format: int64
        - name: organizationTypeIds
          in: query
          description: Organization types
          required: false
          schema:
            type: array
            items:
              type: integer
              format: int64
        - name: organizationIds
          in: query
          description: Organizations
          required: false
          schema:
            type: array
            items:
              type: integer
              format: int64
        - name: venueIds
          in: query
          description: Venues
          required: false
          schema:
            type: array
            items:
              type: integer
              format: int64
        - name: categories
          in: query
          description: Sales card categories (SalesCardCategory)
          required: false
          schema:
            type: array
            items:
              type: string
        - name: sort
          in: query
          description: "Sorting: POPULAR (default) or NEAREST"
          required: false
          schema:
            type: string
        - name: dateFrom
          in: query
          description: >-
            Start of the period, inclusive. Cards with sessions are shown if the period has a session on sale; free
            visits — always
          required: false
          schema:
            type: string
            format: date
        - name: dateTo
          in: query
          description: End of the period, inclusive; without it — the single day dateFrom
          required: false
          schema:
            type: string
            format: date
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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: Symphony concert
                    category: CONCERT
                    saleType: SCHEDULED_SESSION
                    photo:
                      id: 31
                      photoType: HORIZONTAL
                      ru:
                        fileId: 501
                        fileUrl: https://example.com/banner-ru.jpg
                    venue:
                      id: 3
                      name: Grand Hall
                    organization:
                      id: 2
                      name: Concert organization
                    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 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /api/v1/private/agent/catalog/filters:
    get:
      tags:
        - Catalog
      summary: Catalog filter values
      description: Cities, organization types, organizations, venues and categories for which the agent has cards on sale
      operationId: filters
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KassaCatalogFiltersResponse"
        "400":
          description: >-
            1006 — the request fails validation (no such seat, an extra or missing `sessionId`, an invalid `rowId`);
            1007 — invalid request format
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: No token (code 1004), or the token is expired or invalid — in the second case the response body is empty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The account has no agent sales permission
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 1003 — the card, session or order was not found or is not available to your account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: 1001 — failure on the ESBO side
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      parameters:
        - name: Accept-Language
          in: header
          required: false
          description: "Language of names and error texts: 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 of the sales card or session benefit
          format: int64
          example: 9
        quantity:
          maximum: 1000
          minimum: 0
          type: integer
          description: How many tickets use the benefit; 0 — the benefit is not applied
          format: int32
          example: 2
      description: Benefit for some of the order item's tickets
    KassaOrderBenefitsRequest:
      required:
        - benefits
      type: object
      properties:
        benefits:
          type: array
          description: Benefits and how many tickets of the order item each applies to
          items:
            $ref: "#/components/schemas/Benefit"
      description: "All benefits of the order item: they replace the previous ones. An empty list means \"Reset\""
    Item:
      type: object
      properties:
        id:
          type: integer
          description: Order item ID
          format: int64
        itemType:
          $ref: "#/components/schemas/KassaOrderItemType"
        rowId:
          type: integer
          description: ID of the leaf in the tariff or service tree
          format: int64
        itemKey:
          type: string
          description: Row key shared by all card versions
          format: uuid
        name:
          type: string
          description: Tariff or service in the request language
        visitorType:
          type: string
          description: Visitor type ("Adult"); null if there is none
        color:
          type: string
          description: Tariff color code; null for services and tariffs without a color
        quantity:
          type: integer
          description: Quantity
          format: int32
        unitPrice:
          type: number
          description: Unit price
        totalAmount:
          type: number
          description: Amount without discount
        discountAmount:
          type: number
          description: Benefit discount
        finalAmount:
          type: number
          description: Amount with discount
        invite:
          type: boolean
          description: Invitation
        requiresData:
          type: boolean
          description: Additional data required
        sessionId:
          type: integer
          description: Session; null for a free visit
          format: int64
        sessionStartsAt:
          type: string
          description: Session start (Tashkent local time, no offset)
          example: "2026-12-01T19:00:00"
        sessionEndsAt:
          type: string
          description: Session end (Tashkent local time, without an offset)
          example: "2026-12-01T19:00:00"
        seatId:
          type: string
          description: Map seat; null without a seating plan
        sector:
          type: string
          description: Seat sector or standing sector ("Stalls", "Fan zone")
        row:
          type: string
          description: Seat row
        seat:
          type: string
          description: Seat number
        sectorKey:
          type: string
          description: Standing sector key; null for seats and without a map
          format: uuid
        benefits:
          type: array
          description: Order item benefits
          items:
            $ref: "#/components/schemas/OrderItemBenefit"
      description: Order item
    KassaOrderItemType:
      type: string
      description: Order item type
      enum:
        - TARIFF
        - SERVICE
    KassaOrderResponse:
      type: object
      properties:
        id:
          type: integer
          description: Order ID
          format: int64
        salesCardId:
          type: integer
          description: Sales card ID
          format: int64
        versionId:
          type: integer
          description: Card version the prices were calculated from
          format: int64
        status:
          $ref: "#/components/schemas/KassaOrderStatus"
        expiresAt:
          type: string
          description: "When the order expires: 15 minutes from creation (Tashkent local time, without an offset)"
          example: "2026-12-01T19:00:00"
        items:
          type: array
          description: Order items
          items:
            $ref: "#/components/schemas/Item"
        totalAmount:
          type: number
          description: Total without discounts
        discountAmount:
          type: number
          description: Benefit discounts
        finalAmount:
          type: number
          description: Total to pay
        requiresData:
          type: boolean
          description: The order has items that require visitor data before payment
        paymentType:
          $ref: "#/components/schemas/PaymentType"
        ticketLanguage:
          type: string
          description: Ticket language; null until selected
          enum:
            - RU
            - EN
            - UZ
            - UZ_CYRL
            - KAA
            - KAA_CYRL
        group:
          type: boolean
          description: Group ticket
      description: Order with amounts calculated by the server
    KassaOrderStatus:
      type: string
      enum:
        - DRAFT
        - PAID
        - EXPIRED
      description: DRAFT — being built; PAID — paid; EXPIRED — expired
    PaymentType:
      type: string
      enum:
        - AGENT
      description: Payment method; after confirmation — AGENT
    KassaOrderDataRequest:
      required:
        - values
      type: object
      properties:
        values:
          maxItems: 1000
          minItems: 0
          type: array
          description: Values
          items:
            $ref: "#/components/schemas/Value"
      description: Data field values. An empty value deletes the saved one
    Value:
      required:
        - fieldId
        - itemId
        - ticketIndex
      type: object
      properties:
        itemId:
          type: integer
          description: Order item ID
          format: int64
        ticketIndex:
          minimum: 1
          type: integer
          description: Ticket number within the order item, starting at 1
          format: int32
        fieldId:
          type: integer
          description: Reference list field ID
          format: int64
        value:
          maxLength: 500
          minLength: 0
          type: string
          description: Text or option id; empty — delete
      description: Field value for one ticket
    Field:
      type: object
      properties:
        fieldId:
          type: integer
          description: Reference list field ID
          format: int64
        name:
          type: string
          description: Name in the request language
        fieldType:
          type: string
          description: Text input or option selection
          enum:
            - TEXT
            - OPTION
        optionPreset:
          type: string
          description: >-
            Predefined set (countries, regions) — options come from a system reference list, the value is the reference
            list record id
          enum:
            - COUNTRIES
            - REGIONS
        options:
          type: array
          description: The field's own options; the value is the option id
          items:
            $ref: "#/components/schemas/Option"
        required:
          type: boolean
          description: Required
        value:
          type: string
          description: Saved value
      description: Ticket data field
    KassaOrderDataResponse:
      type: object
      properties:
        filled:
          type: integer
          description: Required fields filled ("Filled 3/8")
          format: int32
        total:
          type: integer
          description: Total required fields
          format: int32
        tickets:
          type: array
          description: Tickets that require data
          items:
            $ref: "#/components/schemas/Ticket"
      description: "\"Additional data\" step: fields for each ticket and how many are already filled"
    Option:
      type: object
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
      description: Field option
    Ticket:
      type: object
      properties:
        itemId:
          type: integer
          description: Order item ID
          format: int64
        ticketIndex:
          type: integer
          description: Ticket number within the order item, starting at 1
          format: int32
        name:
          type: string
          description: Tariff or service
        visitorType:
          type: string
          description: Visitor type
        sector:
          type: string
          description: Seat sector
        row:
          type: string
          description: Row
        seat:
          type: string
          description: Seat
        fields:
          type: array
          description: Fields
          items:
            $ref: "#/components/schemas/Field"
      description: "One ticket of an order item: \"Premium (Stalls 3/10)\""
    RefreshTokenRequest:
      required:
        - refreshToken
      type: object
      properties:
        refreshToken:
          type: string
          description: Refresh token
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
      description: Token refresh request
    LoginResponse:
      type: object
      properties:
        accessToken:
          type: string
          description: Access token
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
        refreshToken:
          type: string
          description: Refresh token
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
        expiresIn:
          type: integer
          description: Token lifetime in seconds
          format: int64
          example: 3600
      description: Login response
    LoginRequest:
      required:
        - email
        - password
      type: object
      properties:
        email:
          type: string
          description: Email
          example: user@example.com
          format: email
        password:
          minLength: 8
          type: string
          description: Password
          example: Qwerty123!
      description: Login request
    KassaOrderCreateRequest:
      required:
        - salesCardId
        - versionId
      type: object
      properties:
        salesCardId:
          type: integer
          description: Sales card ID
          format: int64
          example: 7
        versionId:
          type: integer
          description: >-
            Sales card version from `GET /sales-cards/{salesCardId}`. If the card has been updated, the order is not
            created (409) — re-read the card
          format: int64
          example: 70
      description: New order for a sales card
    KassaOrderSectorRequest:
      required:
        - quantity
        - sectorKey
        - sessionId
      type: object
      properties:
        sessionId:
          type: integer
          description: Session
          format: int64
          example: 50
        sectorKey:
          type: string
          description: Standing sector key from the map
          format: uuid
        quantity:
          maximum: 1000
          minimum: 1
          type: integer
          description: How many tickets
          format: int32
          example: 2
        rowId:
          type: integer
          description: Visitor type under the sector's tariff — only if the tariff has visitor types
          format: int64
      description: "Standing sector (fan zone) tickets: by quantity, without seats"
    KassaOrderSeatRequest:
      required:
        - seatId
        - sessionId
      type: object
      properties:
        sessionId:
          type: integer
          description: Session
          format: int64
          example: 50
        seatId:
          maxLength: 100
          minLength: 1
          type: string
          description: Seat ID from `seats[]` of the seating map
          example: seat-parter-3-10
        rowId:
          type: integer
          description: >-
            Visitor type under the seat's tariff — only if the seat's tariff has visitor types with their own prices;
            otherwise not passed
          format: int64
          example: 81
      description: Seat from the seating map to add to the order
    KassaOrderItemRequest:
      required:
        - itemType
        - quantity
        - rowId
      type: object
      properties:
        itemType:
          $ref: "#/components/schemas/KassaOrderItemType"
        rowId:
          type: integer
          description: ID of the leaf in the tariff or service tree
          format: int64
          example: 3
        quantity:
          maximum: 1000
          minimum: 1
          type: integer
          description: Quantity. If the same item is already in the order, the quantity is added
          format: int32
          example: 1
        sessionId:
          type: integer
          description: >-
            Session — required for a card with sessions, empty for a free visit. The tariff and service are taken from
            the contents of this session (GET /api/v1/private/agent/sessions/{sessionId})
          format: int64
          example: 50
      description: Item to add to the order
    AgentConfirmRequest:
      required:
        - ticketLanguage
      type: object
      properties:
        ticketLanguage:
          type: string
          description: "Ticket language: RU, UZ, UZ_CYRL, EN, KAA"
          enum:
            - RU
            - UZ
            - UZ_CYRL
            - EN
            - KAA
        group:
          type: boolean
          description: true — one shared QR code for the whole order; false — a separate QR code for each ticket
      description: "Order confirmation by the agent: payment succeeded on the agent side"
    KassaConfirmResponse:
      type: object
      properties:
        order:
          $ref: "#/components/schemas/KassaOrderResponse"
        tickets:
          $ref: "#/components/schemas/KassaTicketsResponse"
      description: "Confirmation result: order and tickets"
    KassaTicketsResponse:
      type: object
      properties:
        orderId:
          type: integer
          description: Order ID
          format: int64
        group:
          type: boolean
          description: true — one shared QR code for the whole order
        groupQrToken:
          type: string
          description: "Shared order QR code with `group: true`; with `group: false` — null"
        paidAt:
          type: string
          description: When it was paid (Tashkent local time, without an offset)
          example: "2026-12-01T19:00:00"
        tickets:
          type: array
          description: Tickets
          items:
            $ref: "#/components/schemas/AgentTicket"
      description: Tickets of a paid order
    KassaOrderItemQuantityRequest:
      required:
        - quantity
      type: object
      properties:
        quantity:
          maximum: 1000
          minimum: 1
          type: integer
          description: Quantity
          format: int32
          example: 2
      description: New order item quantity; to remove an order item, delete it
    KassaBenefitResponse:
      type: object
      properties:
        id:
          type: integer
          description: Card version benefit row ID
          format: int64
        itemKey:
          type: string
          description: Row key shared by all card versions
          format: uuid
        name:
          type: string
          description: Public name in the request language
        discountPercent:
          type: number
          description: Discount, %
        color:
          type: string
          description: Benefit color on the seating map
        tariffRowIds:
          type: array
          description: IDs of the TARIFF rows the benefit applies to (together with their visitor types)
          items:
            type: integer
            description: IDs of the TARIFF rows the benefit applies to (together with their visitor types)
            format: int64
      description: Sales card benefit
    KassaServiceNode:
      type: object
      properties:
        id:
          type: integer
          description: Card version row ID
          format: int64
        itemKey:
          type: string
          description: Row key shared by all card versions
          format: uuid
        rowType:
          type: string
          description: Row level
          enum:
            - GROUP
            - SERVICE
            - VISITOR_TYPE
        name:
          type: string
          description: Public name in the request language
        description:
          type: string
          description: Public description in the request language
        price:
          type: number
          description: Price; filled only for leaves
        requiresData:
          type: boolean
          description: Additional data must be filled in before payment
        children:
          type: array
          description: Child rows
          items:
            $ref: "#/components/schemas/KassaServiceNode"
      description: "Service tree row: group → service → visitor type. Only leaves are sold"
    KassaSessionSaleResponse:
      type: object
      properties:
        id:
          type: integer
          description: Session ID
          format: int64
        versionId:
          type: integer
          description: Session version the contents were calculated from; you do not need to pass it
          format: int64
        salesCardId:
          type: integer
          description: Sales card ID
          format: int64
        startsAt:
          type: string
          description: Start (Tashkent local time, without an offset)
          example: "2026-12-01T19:00:00"
        endsAt:
          type: string
          description: End (Tashkent local time, without an offset)
          example: "2026-12-01T19:00:00"
        tariffs:
          type: array
          description: Session tariff tree
          items:
            $ref: "#/components/schemas/KassaTariffNode"
        services:
          type: array
          description: Session service tree
          items:
            $ref: "#/components/schemas/KassaServiceNode"
        benefits:
          type: array
          description: Session benefits
          items:
            $ref: "#/components/schemas/KassaBenefitResponse"
      description: "What is sold for the session: tariffs, services and benefits, including those inherited from the card"
    KassaTariffNode:
      type: object
      properties:
        id:
          type: integer
          description: Card version row ID
          format: int64
        itemKey:
          type: string
          description: Row key shared by all card versions
          format: uuid
        rowType:
          type: string
          description: Row level
          enum:
            - GROUP
            - TARIFF
            - VISITOR_TYPE
        name:
          type: string
          description: Public name in the request language
        description:
          type: string
          description: Public description in the request language
        price:
          type: number
          description: Price; set only on tree leaves — only they can be added to an order
        color:
          type: string
          description: Tariff color on the seating map
        ticketCount:
          type: integer
          description: Number of tickets, if capacity is limited
          format: int32
        invite:
          type: boolean
          description: "Invitation tariff: issued in a separate order"
        requiresData:
          type: boolean
          description: Additional data must be filled in before payment
        children:
          type: array
          description: Child rows
          items:
            $ref: "#/components/schemas/KassaTariffNode"
      description: "Tariff tree row: group → tariff → visitor type. Only leaves are sold"
    KassaSeatStatus:
      type: string
      description: Seat status on the seating map
      enum:
        - FREE
        - IN_ORDER
        - HELD
        - SOLD
        - UNAVAILABLE
    KassaSeatingResponse:
      type: object
      properties:
        sessionId:
          type: integer
          description: Session ID
          format: int64
        sessionVersionId:
          type: integer
          description: Session version the map is laid out for
          format: int64
        configurationId:
          type: integer
          description: "Service field: hall configuration"
          format: int64
        tariffs:
          type: array
          description: "\"Tariffs\" legend: map tariffs with the number of seats and benefits"
          items:
            $ref: "#/components/schemas/Tariff"
        seats:
          type: array
          description: Configuration seats
          items:
            $ref: "#/components/schemas/Seat"
        sectors:
          type: array
          description: Configuration sectors; standing ones have capacity and remainder
          items:
            $ref: "#/components/schemas/Sector"
      description: "Session seating map: tariffs, seats and sectors with statuses"
    Seat:
      type: object
      properties:
        seatId:
          type: string
          description: Seat ID
        sectorKey:
          type: string
          description: The sector the seat belongs to
          format: uuid
        sector:
          type: string
          description: Sector in the request language ("Stalls")
        row:
          type: string
          description: Row
        seat:
          type: string
          description: Seat
        tariffRowId:
          type: integer
          description: TARIFF row ID; null — the seat is not for sale
          format: int64
        benefitId:
          type: integer
          description: ID of the benefit assigned to the seat; null — no benefit
          format: int64
        price:
          type: number
          description: Tariff price without a benefit; null if the tariff has visitor types
        status:
          $ref: "#/components/schemas/KassaSeatStatus"
      description: Seat
    Sector:
      type: object
      properties:
        sectorKey:
          type: string
          description: Sector key
          format: uuid
        name:
          type: string
          description: Name in the request language
        ga:
          type: boolean
          description: "Standing sector (fan zone): tickets are sold by quantity, without seats"
        tariffRowId:
          type: integer
          description: Standing sector tariff; null for a seated sector and for an unassigned one
          format: int64
        capacity:
          type: integer
          description: Standing sector capacity
          format: int32
        available:
          type: integer
          description: How many standing sector tickets can still be sold
          format: int32
      description: "Map sector: for a two-level map — the first level"
    Tariff:
      type: object
      properties:
        tariffRowId:
          type: integer
          description: TARIFF row ID
          format: int64
        name:
          type: string
          description: Name in the request language
        description:
          type: string
          description: Description in the request language
        color:
          type: string
          description: Color on the map
        price:
          type: number
          description: Price; null if the tariff has visitor types with their own prices
        invite:
          type: boolean
          description: Invitation
        seatCount:
          type: integer
          description: Seats per tariff, including standing sector capacity; excluding those withdrawn from sale
          format: int32
        benefits:
          type: array
          description: Benefits on seats of this tariff
          items:
            $ref: "#/components/schemas/TariffBenefit"
      description: Map tariff
    TariffBenefit:
      type: object
      properties:
        benefitId:
          type: integer
          format: int64
        name:
          type: string
        color:
          type: string
        discountPercent:
          type: number
        seatCount:
          type: integer
          format: int32
      description: "Benefit on seats of the tariff: \"Seniors − 30% • 100 seats\""
    KassaReference:
      type: object
      properties:
        id:
          type: integer
          description: ID
          format: int64
        name:
          type: string
          description: Name
      description: "Object reference: id and name in the request language"
    KassaSaleCardResponse:
      type: object
      properties:
        id:
          type: integer
          description: Sales card ID
          format: int64
        versionId:
          type: integer
          description: ID of the version being sold; the same one is passed when creating an order
          format: int64
        name:
          type: string
          description: Name in the request language
        category:
          type: string
          description: Category
          enum:
            - MUSEUM_VISIT
            - CONCERT
            - THEATER
            - CINEMA
            - EXHIBITION
            - EXCURSION
            - CULTURAL_EVENT
            - SPORT_EVENT
            - SHOW
            - CONFERENCE
            - EDUCATIONAL
            - OTHER
        saleType:
          type: string
          description: "Sale type: free visit or sessions"
          enum:
            - FREE_VISIT
            - SCHEDULED_SESSION
        photo:
          $ref: "#/components/schemas/SalesCardPhotoResponse"
        venue:
          $ref: "#/components/schemas/KassaReference"
        organization:
          $ref: "#/components/schemas/KassaReference"
        tariffs:
          type: array
          description: Tariff tree
          items:
            $ref: "#/components/schemas/KassaTariffNode"
        services:
          type: array
          description: Service tree
          items:
            $ref: "#/components/schemas/KassaServiceNode"
        benefits:
          type: array
          description: Benefits
          items:
            $ref: "#/components/schemas/KassaBenefitResponse"
      description: "Sales card: current published version"
    SalesCardPhotoFile:
      type: object
      properties:
        fileId:
          type: integer
          description: File ID from the files module
          format: int64
          example: 42
        fileUrl:
          maxLength: 1000
          minLength: 0
          type: string
          description: Banner file URL
      description: Uploaded banner file in one language
    SalesCardPhotoResponse:
      type: object
      properties:
        id:
          type: integer
          description: Banner row ID
          format: int64
        photoType:
          type: string
          description: Banner size
          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: A banner of one size with a file for each language
    KassaSessionResponse:
      type: object
      properties:
        id:
          type: integer
          description: Session ID
          format: int64
        versionId:
          type: integer
          description: Session version currently on sale
          format: int64
        startsAt:
          type: string
          description: Start (Tashkent local time, without an offset)
          example: "2026-12-01T19:00:00"
        endsAt:
          type: string
          description: End (Tashkent local time, without an offset)
          example: "2026-12-01T19:00:00"
        availableTickets:
          type: integer
          description: >-
            How many tickets can still be sold (badge on the session); null — unlimited: the session has no map and
            tariff capacity is not set
          format: int32
      description: Sales card session
    KassaOrderListResponse:
      type: object
      properties:
        items:
          type: array
          description: Orders — the same contents as an order by ID
          items:
            $ref: "#/components/schemas/KassaOrderResponse"
        totalElements:
          type: integer
          description: Total items
          format: int64
        page:
          type: integer
          description: Current page number
          format: int32
        size:
          type: integer
          description: Page size
          format: int32
        totalPages:
          type: integer
          description: Total pages
          format: int32
      description: Page of agent orders
    KassaCatalogItemResponse:
      type: object
      properties:
        id:
          type: integer
          description: Sales card ID
          format: int64
        name:
          type: string
          description: Name in the request language
        category:
          type: string
          description: Category
          enum:
            - MUSEUM_VISIT
            - CONCERT
            - THEATER
            - CINEMA
            - EXHIBITION
            - EXCURSION
            - CULTURAL_EVENT
            - SPORT_EVENT
            - SHOW
            - CONFERENCE
            - EDUCATIONAL
            - OTHER
        saleType:
          type: string
          description: "Sale type: free visit or sessions"
          enum:
            - FREE_VISIT
            - SCHEDULED_SESSION
        photo:
          $ref: "#/components/schemas/SalesCardPhotoResponse"
        venue:
          $ref: "#/components/schemas/KassaReference"
        organization:
          $ref: "#/components/schemas/KassaReference"
        minPrice:
          type: number
          description: >-
            Minimum non-zero tariff price ("from N UZS"); for a card with sessions — across the sessions on sale in the
            selected period; null if there are no tariffs
        nearestSession:
          $ref: "#/components/schemas/KassaSessionTime"
        sessionCount:
          type: integer
          description: Total number of sessions on sale in the selected period; "+N" on the card is sessionCount − 1
          format: int32
      description: Sales card in the catalog
    KassaCatalogResponse:
      type: object
      properties:
        items:
          type: array
          description: Sales cards
          items:
            $ref: "#/components/schemas/KassaCatalogItemResponse"
        totalElements:
          type: integer
          description: Total items
          format: int64
        page:
          type: integer
          description: Current page number
          format: int32
        size:
          type: integer
          description: Page size
          format: int32
        totalPages:
          type: integer
          description: Total pages
          format: int32
      description: Catalog page
    KassaSessionTime:
      type: object
      properties:
        startsAt:
          type: string
          description: Start (Tashkent local time, without an offset)
          example: "2026-12-01T19:00:00"
        endsAt:
          type: string
          description: End (Tashkent local time, without an offset)
          example: "2026-12-01T19:00:00"
      description: Session time
    KassaCatalogFiltersResponse:
      type: object
      properties:
        cities:
          type: array
          description: Cities (venue regions)
          items:
            $ref: "#/components/schemas/KassaReference"
        organizationTypes:
          type: array
          description: Organization types
          items:
            $ref: "#/components/schemas/KassaReference"
        organizations:
          type: array
          description: Organizations
          items:
            $ref: "#/components/schemas/KassaReference"
        venues:
          type: array
          description: Venues
          items:
            $ref: "#/components/schemas/KassaReference"
        categories:
          type: array
          description: Sales card categories
          items:
            type: string
            description: Sales card categories
            enum:
              - MUSEUM_VISIT
              - CONCERT
              - THEATER
              - CINEMA
              - EXHIBITION
              - EXCURSION
              - CULTURAL_EVENT
              - SPORT_EVENT
              - SHOW
              - CONFERENCE
              - EDUCATIONAL
              - OTHER
      description: "Catalog filter values: only those for which the agent has sales cards on sale"
    ErrorResponse:
      type: object
      description: Error response body
      properties:
        detail:
          type: string
          description: Error text in the language from `Accept-Language`; starts with a short request identifier in square brackets
        code:
          type: string
          description: "Error code: 1001, 1003, 1004, 1006, 1007, 1008"
        path:
          type: string
          description: Request path on the server
        timestamp:
          type: string
          description: Response time
          example: "2026-12-01 12:01:05"
        traceId:
          type: string
          description: Request identifier — include it when contacting support
      example:
        detail: "[74132A13AB1A] Resource not found."
        code: "1003"
        path: /esbo/api/v1/private/agent/sales-cards/7
        timestamp: "2026-12-01 12:00:10"
        traceId: 74132a13ab1a4e9db473763b11639bf9
    AgentTicket:
      type: object
      description: Ticket
      properties:
        id:
          type: string
          format: uuid
          description: Ticket ID
        number:
          type: string
          description: Ticket number
        itemId:
          type: integer
          format: int64
          description: Order item ID
        name:
          type: string
          description: Tariff or service name
        visitorType:
          type: string
          nullable: true
          description: Visitor type
        sessionId:
          type: integer
          format: int64
          nullable: true
          description: Session; null for a free visit
        sessionStartsAt:
          type: string
          description: Session start (Tashkent local time)
          example: "2026-12-01T19:00:00"
          nullable: true
        sessionEndsAt:
          type: string
          description: Session end (Tashkent local time)
          example: "2026-12-01T19:00:00"
          nullable: true
        sector:
          type: string
          nullable: true
          description: Sector; null for a ticket without a seat
        row:
          type: string
          nullable: true
          description: Row; null for a ticket without a seat
        seat:
          type: string
          nullable: true
          description: Seat; null for a ticket without a seat
        price:
          type: number
          description: Ticket price, sum
        benefit:
          type: string
          nullable: true
          description: Benefit, if applied
        qrToken:
          type: string
          description: The string that is encoded into the ticket QR code. Deliver it only to the buyer
        language:
          type: string
          enum:
            - RU
            - UZ
            - UZ_CYRL
            - EN
            - KAA
          description: Ticket language
        status:
          type: string
          enum:
            - ACTIVE
          description: Ticket status
    OrderItemBenefit:
      type: object
      description: Benefit for some of the order item's tickets
      properties:
        benefitId:
          type: integer
          format: int64
          description: Benefit ID
        name:
          type: string
          description: Name in the request language
        color:
          type: string
          description: Benefit color code
        discountPercent:
          type: number
          description: Discount, %
        quantity:
          type: integer
          format: int32
          description: How many tickets with the benefit
        discountAmount:
          type: number
          description: Discount amount
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: accessToken from `POST /api/v1/public/agent/login`
