openapi: 3.0.3
info:
  title: 'Emehmon Sync API Documentation'
  description: 'This API gives you access to all the features of Emehmon Sync programmatically.'
  version: 1.0.0
servers:
  -
    url: 'https://api.emehmon.uz'
tags:
  -
    name: 'CRM Hotel API'
    description: ''
  -
    name: 'Sync API'
    description: ''
  -
    name: 'Sync API Meta'
    description: ''
paths:
  /sync/v1/crm/dictionaries-meta:
    get:
      summary: 'Хеш-версии справочников — чтобы понять, нужно ли перечитывать содержимое.'
      operationId: ''
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    locale: ru
                    known:
                      - countries
                      - regions
                      - districts
                      - room-types
                      - visit-types
                      - guest-types
                      - passport-types
                      - visa-types
                      - payment-types
                    versions:
                      countries:
                        version: 0563a7d5a3cf
                        count: 250
                      regions:
                        version: 423847f4b3bc
                        count: 14
                      room-types:
                        version: 5709ead1a80e
                        count: 6
                      visit-types:
                        version: 1c9f0b2d7e41
                        count: 4
                      guest-types:
                        version: 8e2a6f1b3c05
                        count: 5
                      passport-types:
                        version: b7d4e9a2c611
                        count: 8
                      visa-types:
                        version: d3f8a1c5e972
                        count: 12
                      payment-types:
                        version: f19c4b7e2a38
                        count: 4
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      locale:
                        type: string
                        example: ru
                      known:
                        type: array
                        example:
                          - countries
                          - regions
                          - districts
                          - room-types
                          - visit-types
                          - guest-types
                          - passport-types
                          - visa-types
                          - payment-types
                        items:
                          type: string
                      versions:
                        type: object
                        properties:
                          countries:
                            type: object
                            properties:
                              version:
                                type: string
                                example: 0563a7d5a3cf
                              count:
                                type: integer
                                example: 250
                          regions:
                            type: object
                            properties:
                              version:
                                type: string
                                example: 423847f4b3bc
                              count:
                                type: integer
                                example: 14
                          room-types:
                            type: object
                            properties:
                              version:
                                type: string
                                example: 5709ead1a80e
                              count:
                                type: integer
                                example: 6
                          visit-types:
                            type: object
                            properties:
                              version:
                                type: string
                                example: 1c9f0b2d7e41
                              count:
                                type: integer
                                example: 4
                          guest-types:
                            type: object
                            properties:
                              version:
                                type: string
                                example: 8e2a6f1b3c05
                              count:
                                type: integer
                                example: 5
                          passport-types:
                            type: object
                            properties:
                              version:
                                type: string
                                example: b7d4e9a2c611
                              count:
                                type: integer
                                example: 8
                          visa-types:
                            type: object
                            properties:
                              version:
                                type: string
                                example: d3f8a1c5e972
                              count:
                                type: integer
                                example: 12
                          payment-types:
                            type: object
                            properties:
                              version:
                                type: string
                                example: f19c4b7e2a38
                              count:
                                type: integer
                                example: 4
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
  '/sync/v1/crm/dictionaries/{name}':
    get:
      summary: "Справочник по имени. Локализация — `Accept-Language: ru | uz | en`.\n Только `districts` поддерживает фильтр `?region_id=`."
      operationId: AcceptLanguageRuUzEndistrictsregionId
      description: ''
      parameters:
        -
          in: query
          name: region_id
          description: 'Только для `districts` — фильтр по региону.'
          example: 1726
          required: false
          schema:
            type: integer
            description: 'Только для `districts` — фильтр по региону.'
            example: 1726
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    name: countries
                    locale: ru
                    count: 2
                    items:
                      -
                        id: 173
                        name: Узбекистан
                        code: UZB
                      -
                        id: 231
                        name: Казахстан
                        code: KAZ
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      name:
                        type: string
                        example: countries
                      locale:
                        type: string
                        example: ru
                      count:
                        type: integer
                        example: 2
                      items:
                        type: array
                        example:
                          -
                            id: 173
                            name: Узбекистан
                            code: UZB
                          -
                            id: 231
                            name: Казахстан
                            code: KAZ
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 173
                            name:
                              type: string
                              example: Узбекистан
                            code:
                              type: string
                              example: UZB
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 404
                  message: 'Dictionary not found'
                  error_code: DICTIONARY_NOT_FOUND
                  meta:
                    name: unknown
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 404
                  message:
                    type: string
                    example: 'Dictionary not found'
                  error_code:
                    type: string
                    example: DICTIONARY_NOT_FOUND
                  meta:
                    type: object
                    properties:
                      name:
                        type: string
                        example: unknown
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
    parameters:
      -
        in: path
        name: name
        description: 'Имя справочника: countries, regions, districts, room-types, visit-types, guest-types, passport-types, visa-types, payment-types.'
        example: countries
        required: true
        schema:
          type: string
  /sync/v1/crm/hotel:
    get:
      summary: "Карточка вашей гостиницы: реквизиты, лицензия, депозит и флаг `can_register_listok`\n с причинами блокировки."
      operationId: canRegisterListok
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    hotel_id: 1234
                    name: 'Hotel Example'
                    inn: '300123456'
                    stars: 4
                    address: 'Tashkent, Amir Temur 1'
                    region_id: 1726
                    district_id: 1726269
                    phone: '+998 71 200 00 00'
                    email: info@example.uz
                    manager: 'Иванов И.И.'
                    license:
                      number: TR-12345
                      expires_at: '2027-12-31'
                      is_valid: true
                    deposit: 4500000
                    can_register_listok: true
                    blocking_reasons: []
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      hotel_id:
                        type: integer
                        example: 1234
                      name:
                        type: string
                        example: 'Hotel Example'
                      inn:
                        type: string
                        example: '300123456'
                      stars:
                        type: integer
                        example: 4
                      address:
                        type: string
                        example: 'Tashkent, Amir Temur 1'
                      region_id:
                        type: integer
                        example: 1726
                      district_id:
                        type: integer
                        example: 1726269
                      phone:
                        type: string
                        example: '+998 71 200 00 00'
                      email:
                        type: string
                        example: info@example.uz
                      manager:
                        type: string
                        example: 'Иванов И.И.'
                      license:
                        type: object
                        properties:
                          number:
                            type: string
                            example: TR-12345
                          expires_at:
                            type: string
                            example: '2027-12-31'
                          is_valid:
                            type: boolean
                            example: true
                      deposit:
                        type: integer
                        example: 4500000
                      can_register_listok:
                        type: boolean
                        example: true
                      blocking_reasons:
                        type: array
                        example: []
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
  /sync/v1/crm/hotel/rooms:
    get:
      summary: 'Список номеров гостиницы с типами. `room_type_name` локализуется по `Accept-Language`.'
      operationId: roomTypeNameAcceptLanguage
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    count: 2
                    items:
                      -
                        id: 1011
                        room_number: '101'
                        room_type_id: 1
                        room_type_name: Стандарт
                      -
                        id: 1012
                        room_number: '201'
                        room_type_id: 2
                        room_type_name: Люкс
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      count:
                        type: integer
                        example: 2
                      items:
                        type: array
                        example:
                          -
                            id: 1011
                            room_number: '101'
                            room_type_id: 1
                            room_type_name: Стандарт
                          -
                            id: 1012
                            room_number: '201'
                            room_type_id: 2
                            room_type_name: Люкс
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1011
                            room_number:
                              type: string
                              example: '101'
                            room_type_id:
                              type: integer
                              example: 1
                            room_type_name:
                              type: string
                              example: Стандарт
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
  /sync/v1/crm/hotel/prices:
    get:
      summary: 'Действующий прайс: одна запись на `room_type_id` (самая свежая).'
      operationId: roomTypeId
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    count: 1
                    items:
                      -
                        price_id: 8821
                        room_type_id: 1
                        room_type_name: Стандарт
                        beds: 2
                        capacity: 2
                        uzs: 450000.0
                        usd: 38.0
                        uzs_noresident: 550000.0
                        usd_noresident: 48.0
                        breakfast: true
                        dt: '2026-05-01'
                        created_at: '2026-05-01 09:15:32'
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      count:
                        type: integer
                        example: 1
                      items:
                        type: array
                        example:
                          -
                            price_id: 8821
                            room_type_id: 1
                            room_type_name: Стандарт
                            beds: 2
                            capacity: 2
                            uzs: 450000
                            usd: 38
                            uzs_noresident: 550000
                            usd_noresident: 48
                            breakfast: true
                            dt: '2026-05-01'
                            created_at: '2026-05-01 09:15:32'
                        items:
                          type: object
                          properties:
                            price_id:
                              type: integer
                              example: 8821
                            room_type_id:
                              type: integer
                              example: 1
                            room_type_name:
                              type: string
                              example: Стандарт
                            beds:
                              type: integer
                              example: 2
                            capacity:
                              type: integer
                              example: 2
                            uzs:
                              type: number
                              example: 450000.0
                            usd:
                              type: number
                              example: 38.0
                            uzs_noresident:
                              type: number
                              example: 550000.0
                            usd_noresident:
                              type: number
                              example: 48.0
                            breakfast:
                              type: boolean
                              example: true
                            dt:
                              type: string
                              example: '2026-05-01'
                            created_at:
                              type: string
                              example: '2026-05-01 09:15:32'
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
    put:
      summary: "Обновление прайса (batch). Каждый элемент создаёт новую запись;\n действующая цена — самая свежая по room_type_id."
      operationId: batchRoomTypeId
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses: {  }
      tags:
        - 'CRM Hotel API'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                items:
                  type: array
                  description: 'Массив цен (1..50). Каждая запись — новая строка истории в tb_room_prices; действует самая свежая на пару (гостиница, тип номера). validation.min validation.max.'
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      room_type_id:
                        type: integer
                        description: validation.min.
                        example: 16
                      uzs:
                        type: number
                        description: validation.min.
                        example: 39
                        nullable: true
                      usd:
                        type: number
                        description: validation.min.
                        example: 84
                        nullable: true
                      uzs_noresident:
                        type: number
                        description: validation.min.
                        example: 12
                        nullable: true
                      usd_noresident:
                        type: number
                        description: validation.min.
                        example: 77
                        nullable: true
                      beds:
                        type: integer
                        description: 'validation.min validation.max.'
                        example: 5
                        nullable: true
                      capacity:
                        type: integer
                        description: 'validation.min validation.max.'
                        example: 13
                        nullable: true
                      breakfast:
                        type: boolean
                        description: ''
                        example: true
                        nullable: true
                    required:
                      - room_type_id
              required:
                - items
      security: []
  /sync/v1/crm/hotel/photos:
    get:
      summary: 'Список фото гостиницы: главное (`is_main`) первым, затем по убыванию `id`.'
      operationId: isMainid
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    count: 1
                    items:
                      -
                        photo_id: 5577
                        filename: 123_661b3a8f4c12d.png
                        storage_path: hotelimages/123_661b3a8f4c12d.png
                        room_type_id: 1
                        is_main: true
                        created_at: '2026-05-22 13:45:10'
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      count:
                        type: integer
                        example: 1
                      items:
                        type: array
                        example:
                          -
                            photo_id: 5577
                            filename: 123_661b3a8f4c12d.png
                            storage_path: hotelimages/123_661b3a8f4c12d.png
                            room_type_id: 1
                            is_main: true
                            created_at: '2026-05-22 13:45:10'
                        items:
                          type: object
                          properties:
                            photo_id:
                              type: integer
                              example: 5577
                            filename:
                              type: string
                              example: 123_661b3a8f4c12d.png
                            storage_path:
                              type: string
                              example: hotelimages/123_661b3a8f4c12d.png
                            room_type_id:
                              type: integer
                              example: 1
                            is_main:
                              type: boolean
                              example: true
                            created_at:
                              type: string
                              example: '2026-05-22 13:45:10'
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
    post:
      summary: 'Загрузка одного фото гостиницы (multipart/form-data).'
      operationId: multipartformData
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses: {  }
      tags:
        - 'CRM Hotel API'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                photo:
                  type: string
                  format: binary
                  description: 'Файл изображения: jpeg или png, размером ≤ 2 MB. Must be a file. validation.image validation.max.'
                room_type_id:
                  type: integer
                  description: 'ID типа номера, к которому относится фото (необязательно). validation.min.'
                  example: 1
                  nullable: true
                is_main:
                  type: boolean
                  description: 'Сделать фото основным для гостиницы (предыдущее основное сбрасывается).'
                  example: false
                  nullable: true
              required:
                - photo
      security: []
  '/sync/v1/crm/hotel/photos/{id}':
    delete:
      summary: ''
      operationId: deleteSyncV1CrmHotelPhotosId
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses: {  }
      tags:
        - 'CRM Hotel API'
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the photo.'
        example: '564'
        required: true
        schema:
          type: string
  /sync/v1/crm/listok/check-can-create:
    get:
      summary: 'Может ли гостиница регистрировать листовки (статус, лицензия, депозит).'
      operationId: ''
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    can_create: true
                    blocking_reasons: []
                    deposit: 4500000
                    license_expires_at: '2027-12-31'
                    deposit_alert: null
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      can_create:
                        type: boolean
                        example: true
                      blocking_reasons:
                        type: array
                        example: []
                      deposit:
                        type: integer
                        example: 4500000
                      license_expires_at:
                        type: string
                        example: '2027-12-31'
                      deposit_alert:
                        type: string
                        example: null
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
  /sync/v1/crm/listok/check-duplicate:
    post:
      summary: 'Pre-flight проверка на дубликаты по паспорту.'
      operationId: preFlight
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses: {  }
      tags:
        - 'CRM Hotel API'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                passportNumber:
                  type: string
                  description: 'Серия и номер паспорта для проверки активной листовки в этой и других гостиницах. validation.max.'
                  example: AB1234567
              required:
                - passportNumber
      security: []
  /sync/v1/crm/listok/person-lookup:
    post:
      summary: 'Lookup `person_id` иностранца в базе Погран.Службы (до регистрации листовки).'
      operationId: lookuppersonId
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses: {  }
      tags:
        - 'CRM Hotel API'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                passportNumber:
                  type: string
                  description: 'Серия и номер паспорта иностранца. validation.max.'
                  example: AB1234567
                datebirth:
                  type: string
                  description: 'Дата рождения, ISO 8601 (YYYY-MM-DD). validation.date.'
                  example: '1990-05-15'
                id_citizen:
                  type: integer
                  description: 'Код гражданства из справочника `/dictionaries/countries`.'
                  example: 76
              required:
                - passportNumber
                - datebirth
                - id_citizen
      security: []
  /sync/v1/crm/listok:
    get:
      summary: "Список листовок гостиницы с фильтрами. Сортировка — `id DESC`.\n\n **Текущие проживающие** (то же множество, что «текущие зарегистрированные» в кабинете\n emehmon.uz): `?active=1` — листовки без выселения (`dateVisitOff IS NULL`).\n Для сверки с PMS выгружайте страницами: `?active=1&per_page=200&page=N`,\n число страниц — `ceil(total / per_page)`."
      operationId: idDESCEmehmonuzactive1dateVisitOffISNULLPMSactive1perPage200pageNceiltotalPerPage
      description: ''
      parameters:
        -
          in: query
          name: date_from
          description: 'Фильтр: дата заселения от (Y-m-d). Must be a valid date in the format <code>Y-m-d</code>.'
          example: '2026-05-01'
          required: false
          schema:
            type: string
            description: 'Фильтр: дата заселения от (Y-m-d). Must be a valid date in the format <code>Y-m-d</code>.'
            example: '2026-05-01'
            nullable: true
        -
          in: query
          name: date_to
          description: 'Фильтр: дата заселения до (Y-m-d), не раньше date_from. Must be a valid date in the format <code>Y-m-d</code>. validation.after_or_equal.'
          example: '2026-05-31'
          required: false
          schema:
            type: string
            description: 'Фильтр: дата заселения до (Y-m-d), не раньше date_from. Must be a valid date in the format <code>Y-m-d</code>. validation.after_or_equal.'
            example: '2026-05-31'
            nullable: true
        -
          in: query
          name: passport
          description: 'Фильтр по серии/номеру паспорта. validation.max.'
          example: AB1234567
          required: false
          schema:
            type: string
            description: 'Фильтр по серии/номеру паспорта. validation.max.'
            example: AB1234567
            nullable: true
        -
          in: query
          name: surname
          description: 'Фильтр по фамилии (частичное совпадение). validation.max.'
          example: Каримов
          required: false
          schema:
            type: string
            description: 'Фильтр по фамилии (частичное совпадение). validation.max.'
            example: Каримов
            nullable: true
        -
          in: query
          name: active
          description: '1 — только активные (не выселенные, dateVisitOff IS NULL) листовки; 0 — только выселенные. То же множество, что «текущие зарегистрированные» в кабинете.'
          example: true
          required: false
          schema:
            type: boolean
            description: '1 — только активные (не выселенные, dateVisitOff IS NULL) листовки; 0 — только выселенные. То же множество, что «текущие зарегистрированные» в кабинете.'
            example: true
            nullable: true
        -
          in: query
          name: page
          description: 'Номер страницы (с 1). validation.min.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'Номер страницы (с 1). validation.min.'
            example: 1
            nullable: true
        -
          in: query
          name: per_page
          description: 'Размер страницы (1..200, по умолчанию 50). validation.min validation.max.'
          example: 50
          required: false
          schema:
            type: integer
            description: 'Размер страницы (1..200, по умолчанию 50). validation.min validation.max.'
            example: 50
            nullable: true
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    total: 1
                    page: 1
                    per_page: 50
                    items:
                      -
                        listok_id: 8826912
                        regNum: 1726-2026-00012345
                        surname: MUSTERMANN
                        firstname: MAX
                        lastname: null
                        pinfl: null
                        id_citizen: 5
                        id_country: 5
                        id_countryFrom: 5
                        id_passporttype: 1
                        id_visittype: 2
                        id_guest: 1
                        id_person: '1234567890'
                        id_visatype: 3
                        passportNumber: C01X00T47
                        datePassport: '2021-03-15'
                        datebirth: '1985-07-12'
                        sex: M
                        datevisiton: '2026-08-30 14:30:00'
                        datevisitoff: null
                        wdays: 3
                        lived_days: null
                        propiska: '101'
                        room_type_id: 1
                        visaNumber: null
                        dateVisaOn: null
                        dateVisaOff: null
                        kppNumber: null
                        dateKPP: null
                        amount: null
                        payed: 0
                        paytp: null
                        summa: null
                        real_summa: null
                        real_days: null
                        registered_via: 2
                        created_at: '2026-08-30 14:30:12'
                        updated_at: '2026-08-30 14:30:12'
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 1
                      page:
                        type: integer
                        example: 1
                      per_page:
                        type: integer
                        example: 50
                      items:
                        type: array
                        example:
                          -
                            listok_id: 8826912
                            regNum: 1726-2026-00012345
                            surname: MUSTERMANN
                            firstname: MAX
                            lastname: null
                            pinfl: null
                            id_citizen: 5
                            id_country: 5
                            id_countryFrom: 5
                            id_passporttype: 1
                            id_visittype: 2
                            id_guest: 1
                            id_person: '1234567890'
                            id_visatype: 3
                            passportNumber: C01X00T47
                            datePassport: '2021-03-15'
                            datebirth: '1985-07-12'
                            sex: M
                            datevisiton: '2026-08-30 14:30:00'
                            datevisitoff: null
                            wdays: 3
                            lived_days: null
                            propiska: '101'
                            room_type_id: 1
                            visaNumber: null
                            dateVisaOn: null
                            dateVisaOff: null
                            kppNumber: null
                            dateKPP: null
                            amount: null
                            payed: 0
                            paytp: null
                            summa: null
                            real_summa: null
                            real_days: null
                            registered_via: 2
                            created_at: '2026-08-30 14:30:12'
                            updated_at: '2026-08-30 14:30:12'
                        items:
                          type: object
                          properties:
                            listok_id:
                              type: integer
                              example: 8826912
                            regNum:
                              type: string
                              example: 1726-2026-00012345
                            surname:
                              type: string
                              example: MUSTERMANN
                            firstname:
                              type: string
                              example: MAX
                            lastname:
                              type: string
                              example: null
                            pinfl:
                              type: string
                              example: null
                            id_citizen:
                              type: integer
                              example: 5
                            id_country:
                              type: integer
                              example: 5
                            id_countryFrom:
                              type: integer
                              example: 5
                            id_passporttype:
                              type: integer
                              example: 1
                            id_visittype:
                              type: integer
                              example: 2
                            id_guest:
                              type: integer
                              example: 1
                            id_person:
                              type: string
                              example: '1234567890'
                            id_visatype:
                              type: integer
                              example: 3
                            passportNumber:
                              type: string
                              example: C01X00T47
                            datePassport:
                              type: string
                              example: '2021-03-15'
                            datebirth:
                              type: string
                              example: '1985-07-12'
                            sex:
                              type: string
                              example: M
                            datevisiton:
                              type: string
                              example: '2026-08-30 14:30:00'
                            datevisitoff:
                              type: string
                              example: null
                            wdays:
                              type: integer
                              example: 3
                            lived_days:
                              type: string
                              example: null
                            propiska:
                              type: string
                              example: '101'
                            room_type_id:
                              type: integer
                              example: 1
                            visaNumber:
                              type: string
                              example: null
                            dateVisaOn:
                              type: string
                              example: null
                            dateVisaOff:
                              type: string
                              example: null
                            kppNumber:
                              type: string
                              example: null
                            dateKPP:
                              type: string
                              example: null
                            amount:
                              type: string
                              example: null
                            payed:
                              type: integer
                              example: 0
                            paytp:
                              type: string
                              example: null
                            summa:
                              type: string
                              example: null
                            real_summa:
                              type: string
                              example: null
                            real_days:
                              type: string
                              example: null
                            registered_via:
                              type: integer
                              example: 2
                            created_at:
                              type: string
                              example: '2026-08-30 14:30:12'
                            updated_at:
                              type: string
                              example: '2026-08-30 14:30:12'
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
    post:
      summary: 'Регистрация (заселение) гостя.'
      operationId: ''
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses: {  }
      tags:
        - 'CRM Hotel API'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                surname:
                  type: string
                  description: validation.max.
                  example: b
                firstname:
                  type: string
                  description: validation.max.
                  example: 'n'
                lastname:
                  type: string
                  description: validation.max.
                  example: g
                  nullable: true
                id_citizen:
                  type: integer
                  description: validation.min.
                  example: 66
                passportNumber:
                  type: string
                  description: validation.max.
                  example: m
                datePassport:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                datebirth:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                datevisiton:
                  type: string
                  description: validation.date.
                  example: '2026-09-02T14:28:55'
                wdays:
                  type: integer
                  description: 'validation.min validation.max.'
                  example: 15
                sex:
                  type: string
                  description: ''
                  example: M
                  enum:
                    - M
                    - W
                id_visittype:
                  type: integer
                  description: validation.min.
                  example: 43
                id_guest:
                  type: integer
                  description: validation.min.
                  example: 16
                id_person:
                  type: string
                  description: 'Идентификатор лица в системе Погран.Службы. ОБЯЗАТЕЛЕН для иностранцев (id_citizen ∉ {173, 231}) — иначе 422 PERSON_ID_REQUIRED_FOR_FOREIGNER. Дополнительно проверяется в Погран.Службе: если person_id не подтверждён — 422 PERSON_NOT_FOUND_IN_SGB. validation.max.'
                  example: '12345'
                  nullable: true
                propiska:
                  type: string
                  description: validation.max.
                  example: d
                  nullable: true
                id_country:
                  type: integer
                  description: validation.min.
                  example: 40
                  nullable: true
                id_countryFrom:
                  type: integer
                  description: validation.min.
                  example: 4
                  nullable: true
                id_passporttype:
                  type: integer
                  description: validation.min.
                  example: 2
                  nullable: true
                passportIssuedBy:
                  type: string
                  description: validation.max.
                  example: i
                  nullable: true
                pinfl:
                  type: string
                  description: 'ПИНФЛ (14 цифр). ОБЯЗАТЕЛЕН для местных граждан (id_citizen ∈ {173 — UZ, 231 — БГ}), кроме военного билета (id_passporttype=2) — иначе 422 PINFL_REQUIRED_FOR_LOCAL. Можно прислать отдельным полем, даже если основной документ не паспорт (напр. водительские права). validation.max.'
                  example: '31234567890123'
                  nullable: true
                amount:
                  type: number
                  description: validation.min.
                  example: 75
                  nullable: true
                lived_days:
                  type: integer
                  description: validation.min.
                  example: 7
                  nullable: true
                payed:
                  type: integer
                  description: validation.min.
                  example: 87
                  nullable: true
                id_visatype:
                  type: integer
                  description: validation.min.
                  example: 39
                  nullable: true
                visaNumber:
                  type: string
                  description: validation.max.
                  example: 'y'
                  nullable: true
                dateVisaOn:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                  nullable: true
                dateVisaOff:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                  nullable: true
                visaIssuedBy:
                  type: string
                  description: validation.max.
                  example: k
                  nullable: true
                kppNumber:
                  type: string
                  description: validation.max.
                  example: c
                  nullable: true
                dateKPP:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                  nullable: true
                bookingId:
                  type: integer
                  description: validation.min.
                  example: 49
                  nullable: true
                children:
                  type: array
                  description: ''
                  example: null
                  items:
                    type: object
                    nullable: true
                    properties:
                      full_name:
                        type: string
                        description: validation.max.
                        example: w
                        nullable: true
                      gen:
                        type: string
                        description: ''
                        example: M
                        enum:
                          - M
                          - W
                        nullable: true
                      birth_day:
                        type: string
                        description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                        example: '2026-09-02'
                        nullable: true
                crm_actor_id:
                  type: string
                  description: validation.max.
                  example: 'y'
                  nullable: true
                crm_actor_name:
                  type: string
                  description: validation.max.
                  example: u
                  nullable: true
              required:
                - surname
                - firstname
                - id_citizen
                - passportNumber
                - datePassport
                - datebirth
                - datevisiton
                - wdays
                - sex
                - id_visittype
                - id_guest
      security: []
  '/sync/v1/crm/listok/{id}':
    get:
      summary: 'Карточка одной листовки. 404 если не существует; 403 если в другой гостинице.'
      operationId: '404403'
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    listok_id: 8826912
                    regNum: 1726-2026-00012345
                    surname: MUSTERMANN
                    firstname: MAX
                    lastname: null
                    pinfl: null
                    id_citizen: 5
                    id_country: 5
                    id_countryFrom: 5
                    id_passporttype: 1
                    id_visittype: 2
                    id_guest: 1
                    id_person: '1234567890'
                    id_visatype: 3
                    passportNumber: C01X00T47
                    datePassport: '2021-03-15'
                    datebirth: '1985-07-12'
                    sex: M
                    datevisiton: '2026-08-30 14:30:00'
                    datevisitoff: null
                    wdays: 3
                    lived_days: null
                    propiska: '101'
                    room_type_id: 1
                    visaNumber: null
                    dateVisaOn: null
                    dateVisaOff: null
                    kppNumber: null
                    dateKPP: null
                    amount: null
                    payed: 0
                    paytp: null
                    summa: null
                    real_summa: null
                    real_days: null
                    registered_via: 2
                    created_at: '2026-08-30 14:30:12'
                    updated_at: '2026-08-30 14:30:12'
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      listok_id:
                        type: integer
                        example: 8826912
                      regNum:
                        type: string
                        example: 1726-2026-00012345
                      surname:
                        type: string
                        example: MUSTERMANN
                      firstname:
                        type: string
                        example: MAX
                      lastname:
                        type: string
                        example: null
                      pinfl:
                        type: string
                        example: null
                      id_citizen:
                        type: integer
                        example: 5
                      id_country:
                        type: integer
                        example: 5
                      id_countryFrom:
                        type: integer
                        example: 5
                      id_passporttype:
                        type: integer
                        example: 1
                      id_visittype:
                        type: integer
                        example: 2
                      id_guest:
                        type: integer
                        example: 1
                      id_person:
                        type: string
                        example: '1234567890'
                      id_visatype:
                        type: integer
                        example: 3
                      passportNumber:
                        type: string
                        example: C01X00T47
                      datePassport:
                        type: string
                        example: '2021-03-15'
                      datebirth:
                        type: string
                        example: '1985-07-12'
                      sex:
                        type: string
                        example: M
                      datevisiton:
                        type: string
                        example: '2026-08-30 14:30:00'
                      datevisitoff:
                        type: string
                        example: null
                      wdays:
                        type: integer
                        example: 3
                      lived_days:
                        type: string
                        example: null
                      propiska:
                        type: string
                        example: '101'
                      room_type_id:
                        type: integer
                        example: 1
                      visaNumber:
                        type: string
                        example: null
                      dateVisaOn:
                        type: string
                        example: null
                      dateVisaOff:
                        type: string
                        example: null
                      kppNumber:
                        type: string
                        example: null
                      dateKPP:
                        type: string
                        example: null
                      amount:
                        type: string
                        example: null
                      payed:
                        type: integer
                        example: 0
                      paytp:
                        type: string
                        example: null
                      summa:
                        type: string
                        example: null
                      real_summa:
                        type: string
                        example: null
                      real_days:
                        type: string
                        example: null
                      registered_via:
                        type: integer
                        example: 2
                      created_at:
                        type: string
                        example: '2026-08-30 14:30:12'
                      updated_at:
                        type: string
                        example: '2026-08-30 14:30:12'
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 404
                  message: 'Listok not found'
                  error_code: LISTOK_NOT_FOUND
                  meta:
                    listok_id: 1
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 404
                  message:
                    type: string
                    example: 'Listok not found'
                  error_code:
                    type: string
                    example: LISTOK_NOT_FOUND
                  meta:
                    type: object
                    properties:
                      listok_id:
                        type: integer
                        example: 1
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
    patch:
      summary: 'Обновление листовки в grace-period (5 минут после создания).'
      operationId: GracePeriod5
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses: {  }
      tags:
        - 'CRM Hotel API'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                surname:
                  type: string
                  description: validation.max.
                  example: b
                firstname:
                  type: string
                  description: validation.max.
                  example: 'n'
                id_citizen:
                  type: integer
                  description: validation.min.
                  example: 67
                passportNumber:
                  type: string
                  description: validation.max.
                  example: z
                datePassport:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                sex:
                  type: string
                  description: ''
                  example: W
                  enum:
                    - M
                    - W
                id_visittype:
                  type: integer
                  description: validation.min.
                  example: 27
                id_guest:
                  type: integer
                  description: validation.min.
                  example: 35
                propiska:
                  type: string
                  description: 'Номер комнаты / прописка гостя в гостинице. validation.max.'
                  example: '101'
                  nullable: true
                crm_actor_id:
                  type: string
                  description: 'ID сотрудника CRM, внёсшего правку (только для аудита). validation.max.'
                  example: op-42
                  nullable: true
                crm_actor_name:
                  type: string
                  description: validation.max.
                  example: 'y'
                  nullable: true
      security: []
    parameters:
      -
        in: path
        name: id
        description: '`listok_id` из списка.'
        example: 8826912
        required: true
        schema:
          type: integer
  '/sync/v1/crm/listok/{id}/checkout':
    post:
      summary: 'Выселение (checkout) с расчётом турсбора.'
      operationId: checkout
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses: {  }
      tags:
        - 'CRM Hotel API'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sum:
                  type: number
                  description: 'Итоговая сумма к оплате в UZS. validation.min.'
                  example: 350000.0
                payment_type_id:
                  type: integer
                  description: 'ID типа оплаты из справочника /sync/v1/crm/dictionaries/payment-types (1=наличные, 2=безнал и т.п.). validation.min.'
                  example: 1
              required:
                - sum
                - payment_type_id
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the listok.'
        example: '564'
        required: true
        schema:
          type: string
  /sync/v1/crm/self-listok:
    get:
      summary: 'Список самостоятельных регистраций гостиницы с фильтрами. Сортировка — `id DESC`.'
      operationId: idDESC
      description: ''
      parameters:
        -
          in: query
          name: date_from
          description: 'Фильтр: дата заселения от (Y-m-d). Must be a valid date in the format <code>Y-m-d</code>.'
          example: '2026-05-01'
          required: false
          schema:
            type: string
            description: 'Фильтр: дата заселения от (Y-m-d). Must be a valid date in the format <code>Y-m-d</code>.'
            example: '2026-05-01'
            nullable: true
        -
          in: query
          name: date_to
          description: 'Фильтр: дата заселения до (Y-m-d), не раньше date_from. Must be a valid date in the format <code>Y-m-d</code>. validation.after_or_equal.'
          example: '2026-05-31'
          required: false
          schema:
            type: string
            description: 'Фильтр: дата заселения до (Y-m-d), не раньше date_from. Must be a valid date in the format <code>Y-m-d</code>. validation.after_or_equal.'
            example: '2026-05-31'
            nullable: true
        -
          in: query
          name: passport
          description: 'Фильтр по серии/номеру паспорта. validation.max.'
          example: AB7654321
          required: false
          schema:
            type: string
            description: 'Фильтр по серии/номеру паспорта. validation.max.'
            example: AB7654321
            nullable: true
        -
          in: query
          name: surname
          description: 'Фильтр по фамилии (частичное совпадение). validation.max.'
          example: Каримов
          required: false
          schema:
            type: string
            description: 'Фильтр по фамилии (частичное совпадение). validation.max.'
            example: Каримов
            nullable: true
        -
          in: query
          name: page
          description: 'Номер страницы (с 1). validation.min.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'Номер страницы (с 1). validation.min.'
            example: 1
            nullable: true
        -
          in: query
          name: per_page
          description: 'Размер страницы (1..200, по умолчанию 50). validation.min validation.max.'
          example: 50
          required: false
          schema:
            type: integer
            description: 'Размер страницы (1..200, по умолчанию 50). validation.min validation.max.'
            example: 50
            nullable: true
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    total: 1
                    page: 1
                    per_page: 50
                    items:
                      -
                        self_listok_id: 8821934
                        regNum: 1726-2026-S-00001
                        surname: KARIMOV
                        firstname: AZIZ
                        lastname: null
                        id_citizen: 173
                        id_country: 173
                        id_countryFrom: null
                        id_passporttype: 1
                        id_visittype: 2
                        id_guest: 1
                        id_person: null
                        id_visatype: null
                        passportNumber: AA1234567
                        passportIssuedBy: null
                        datePassport: '2020-01-01'
                        datebirth: '1990-01-01'
                        sex: M
                        datevisiton: '2026-08-30 14:30:00'
                        datevisitoff: '2026-09-04 14:30:00'
                        wdays: 5
                        visaNumber: null
                        dateVisaOn: null
                        dateVisaOff: null
                        visaIssuedBy: null
                        kppNumber: KPP-99
                        dateKPP: '2026-08-30'
                        direction: 'Tashkent - Samarkand'
                        a_address: null
                        a_id_region: null
                        a_id_district: null
                        summa: 22500.0
                        mzrp: 412000.0
                        prc: 5.0
                        registered_via: 2
                        hsh: a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
                        created_at: '2026-08-30 14:31:08'
                        updated_at: '2026-08-30 14:31:08'
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 1
                      page:
                        type: integer
                        example: 1
                      per_page:
                        type: integer
                        example: 50
                      items:
                        type: array
                        example:
                          -
                            self_listok_id: 8821934
                            regNum: 1726-2026-S-00001
                            surname: KARIMOV
                            firstname: AZIZ
                            lastname: null
                            id_citizen: 173
                            id_country: 173
                            id_countryFrom: null
                            id_passporttype: 1
                            id_visittype: 2
                            id_guest: 1
                            id_person: null
                            id_visatype: null
                            passportNumber: AA1234567
                            passportIssuedBy: null
                            datePassport: '2020-01-01'
                            datebirth: '1990-01-01'
                            sex: M
                            datevisiton: '2026-08-30 14:30:00'
                            datevisitoff: '2026-09-04 14:30:00'
                            wdays: 5
                            visaNumber: null
                            dateVisaOn: null
                            dateVisaOff: null
                            visaIssuedBy: null
                            kppNumber: KPP-99
                            dateKPP: '2026-08-30'
                            direction: 'Tashkent - Samarkand'
                            a_address: null
                            a_id_region: null
                            a_id_district: null
                            summa: 22500
                            mzrp: 412000
                            prc: 5
                            registered_via: 2
                            hsh: a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
                            created_at: '2026-08-30 14:31:08'
                            updated_at: '2026-08-30 14:31:08'
                        items:
                          type: object
                          properties:
                            self_listok_id:
                              type: integer
                              example: 8821934
                            regNum:
                              type: string
                              example: 1726-2026-S-00001
                            surname:
                              type: string
                              example: KARIMOV
                            firstname:
                              type: string
                              example: AZIZ
                            lastname:
                              type: string
                              example: null
                            id_citizen:
                              type: integer
                              example: 173
                            id_country:
                              type: integer
                              example: 173
                            id_countryFrom:
                              type: string
                              example: null
                            id_passporttype:
                              type: integer
                              example: 1
                            id_visittype:
                              type: integer
                              example: 2
                            id_guest:
                              type: integer
                              example: 1
                            id_person:
                              type: string
                              example: null
                            id_visatype:
                              type: string
                              example: null
                            passportNumber:
                              type: string
                              example: AA1234567
                            passportIssuedBy:
                              type: string
                              example: null
                            datePassport:
                              type: string
                              example: '2020-01-01'
                            datebirth:
                              type: string
                              example: '1990-01-01'
                            sex:
                              type: string
                              example: M
                            datevisiton:
                              type: string
                              example: '2026-08-30 14:30:00'
                            datevisitoff:
                              type: string
                              example: '2026-09-04 14:30:00'
                            wdays:
                              type: integer
                              example: 5
                            visaNumber:
                              type: string
                              example: null
                            dateVisaOn:
                              type: string
                              example: null
                            dateVisaOff:
                              type: string
                              example: null
                            visaIssuedBy:
                              type: string
                              example: null
                            kppNumber:
                              type: string
                              example: KPP-99
                            dateKPP:
                              type: string
                              example: '2026-08-30'
                            direction:
                              type: string
                              example: 'Tashkent - Samarkand'
                            a_address:
                              type: string
                              example: null
                            a_id_region:
                              type: string
                              example: null
                            a_id_district:
                              type: string
                              example: null
                            summa:
                              type: number
                              example: 22500.0
                            mzrp:
                              type: number
                              example: 412000.0
                            prc:
                              type: number
                              example: 5.0
                            registered_via:
                              type: integer
                              example: 2
                            hsh:
                              type: string
                              example: a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
                            created_at:
                              type: string
                              example: '2026-08-30 14:31:08'
                            updated_at:
                              type: string
                              example: '2026-08-30 14:31:08'
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
    post:
      summary: ''
      operationId: postSyncV1CrmSelfListok
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses: {  }
      tags:
        - 'CRM Hotel API'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                surname:
                  type: string
                  description: validation.max.
                  example: b
                firstname:
                  type: string
                  description: validation.max.
                  example: 'n'
                lastname:
                  type: string
                  description: validation.max.
                  example: g
                  nullable: true
                id_citizen:
                  type: integer
                  description: validation.min.
                  example: 66
                passportNumber:
                  type: string
                  description: validation.max.
                  example: m
                datePassport:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                datebirth:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                datevisiton:
                  type: string
                  description: validation.date.
                  example: '2026-09-02T14:28:55'
                wdays:
                  type: integer
                  description: 'validation.min validation.max.'
                  example: 15
                sex:
                  type: string
                  description: ''
                  example: M
                  enum:
                    - M
                    - W
                id_visittype:
                  type: integer
                  description: validation.min.
                  example: 43
                id_guest:
                  type: integer
                  description: validation.min.
                  example: 16
                kppNumber:
                  type: string
                  description: 'Номер КПП пересечения границы. Обязателен для self-listok (нет гостиничного посредника) — иначе 422 KPP_REQUIRED_FOR_SELF_LISTOK. validation.max.'
                  example: KPP-12345
                id_person:
                  type: string
                  description: 'Идентификатор лица в системе Погран.Службы. ОБЯЗАТЕЛЕН для иностранцев (id_citizen ∉ {173, 231}) — иначе 422 PERSON_ID_REQUIRED_FOR_FOREIGNER. Дополнительно проверяется в Погран.Службе: если не подтверждён — 422 PERSON_NOT_FOUND_IN_SGB. validation.max.'
                  example: '12345'
                  nullable: true
                id_country:
                  type: integer
                  description: validation.min.
                  example: 26
                  nullable: true
                id_countryFrom:
                  type: integer
                  description: validation.min.
                  example: 40
                  nullable: true
                id_passporttype:
                  type: integer
                  description: validation.min.
                  example: 4
                  nullable: true
                passportIssuedBy:
                  type: string
                  description: validation.max.
                  example: 'n'
                  nullable: true
                pinfl:
                  type: string
                  description: 'ПИНФЛ (14 цифр). ОБЯЗАТЕЛЕН для местных граждан (id_citizen ∈ {173 — UZ, 231 — БГ}), кроме военного билета (id_passporttype=2) — иначе 422 PINFL_REQUIRED_FOR_LOCAL. validation.max.'
                  example: '31234567890123'
                  nullable: true
                dateKPP:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                  nullable: true
                direction:
                  type: string
                  description: validation.max.
                  example: i
                  nullable: true
                id_visatype:
                  type: integer
                  description: validation.min.
                  example: 75
                  nullable: true
                visaNumber:
                  type: string
                  description: validation.max.
                  example: h
                  nullable: true
                dateVisaOn:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                  nullable: true
                dateVisaOff:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                  nullable: true
                visaIssuedBy:
                  type: string
                  description: validation.max.
                  example: w
                  nullable: true
                children:
                  type: array
                  description: ''
                  example: null
                  items:
                    type: object
                    nullable: true
                    properties:
                      full_name:
                        type: string
                        description: validation.max.
                        example: k
                        nullable: true
                      gen:
                        type: string
                        description: ''
                        example: W
                        enum:
                          - M
                          - W
                        nullable: true
                      birth_day:
                        type: string
                        description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                        example: '2026-09-02'
                        nullable: true
                crm_actor_id:
                  type: string
                  description: validation.max.
                  example: a
                  nullable: true
                crm_actor_name:
                  type: string
                  description: validation.max.
                  example: 'y'
                  nullable: true
              required:
                - surname
                - firstname
                - id_citizen
                - passportNumber
                - datePassport
                - datebirth
                - datevisiton
                - wdays
                - sex
                - id_visittype
                - id_guest
                - kppNumber
      security: []
  '/sync/v1/crm/self-listok/{id}':
    get:
      summary: 'Карточка одной самостоятельной регистрации. 404 если не существует; 403 если в другой гостинице.'
      operationId: '404403'
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    self_listok_id: 8821934
                    regNum: 1726-2026-S-00001
                    surname: KARIMOV
                    firstname: AZIZ
                    lastname: null
                    id_citizen: 173
                    id_country: 173
                    id_countryFrom: null
                    id_passporttype: 1
                    id_visittype: 2
                    id_guest: 1
                    id_person: null
                    id_visatype: null
                    passportNumber: AA1234567
                    passportIssuedBy: null
                    datePassport: '2020-01-01'
                    datebirth: '1990-01-01'
                    sex: M
                    datevisiton: '2026-08-30 14:30:00'
                    datevisitoff: '2026-09-04 14:30:00'
                    wdays: 5
                    visaNumber: null
                    dateVisaOn: null
                    dateVisaOff: null
                    visaIssuedBy: null
                    kppNumber: KPP-99
                    dateKPP: '2026-08-30'
                    direction: 'Tashkent - Samarkand'
                    a_address: null
                    a_id_region: null
                    a_id_district: null
                    summa: 22500.0
                    mzrp: 412000.0
                    prc: 5.0
                    registered_via: 2
                    hsh: a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
                    created_at: '2026-08-30 14:31:08'
                    updated_at: '2026-08-30 14:31:08'
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      self_listok_id:
                        type: integer
                        example: 8821934
                      regNum:
                        type: string
                        example: 1726-2026-S-00001
                      surname:
                        type: string
                        example: KARIMOV
                      firstname:
                        type: string
                        example: AZIZ
                      lastname:
                        type: string
                        example: null
                      id_citizen:
                        type: integer
                        example: 173
                      id_country:
                        type: integer
                        example: 173
                      id_countryFrom:
                        type: string
                        example: null
                      id_passporttype:
                        type: integer
                        example: 1
                      id_visittype:
                        type: integer
                        example: 2
                      id_guest:
                        type: integer
                        example: 1
                      id_person:
                        type: string
                        example: null
                      id_visatype:
                        type: string
                        example: null
                      passportNumber:
                        type: string
                        example: AA1234567
                      passportIssuedBy:
                        type: string
                        example: null
                      datePassport:
                        type: string
                        example: '2020-01-01'
                      datebirth:
                        type: string
                        example: '1990-01-01'
                      sex:
                        type: string
                        example: M
                      datevisiton:
                        type: string
                        example: '2026-08-30 14:30:00'
                      datevisitoff:
                        type: string
                        example: '2026-09-04 14:30:00'
                      wdays:
                        type: integer
                        example: 5
                      visaNumber:
                        type: string
                        example: null
                      dateVisaOn:
                        type: string
                        example: null
                      dateVisaOff:
                        type: string
                        example: null
                      visaIssuedBy:
                        type: string
                        example: null
                      kppNumber:
                        type: string
                        example: KPP-99
                      dateKPP:
                        type: string
                        example: '2026-08-30'
                      direction:
                        type: string
                        example: 'Tashkent - Samarkand'
                      a_address:
                        type: string
                        example: null
                      a_id_region:
                        type: string
                        example: null
                      a_id_district:
                        type: string
                        example: null
                      summa:
                        type: number
                        example: 22500.0
                      mzrp:
                        type: number
                        example: 412000.0
                      prc:
                        type: number
                        example: 5.0
                      registered_via:
                        type: integer
                        example: 2
                      hsh:
                        type: string
                        example: a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
                      created_at:
                        type: string
                        example: '2026-08-30 14:31:08'
                      updated_at:
                        type: string
                        example: '2026-08-30 14:31:08'
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 404
                  message: 'Self-listok not found'
                  error_code: SELF_LISTOK_NOT_FOUND
                  meta:
                    self_listok_id: 1
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 404
                  message:
                    type: string
                    example: 'Self-listok not found'
                  error_code:
                    type: string
                    example: SELF_LISTOK_NOT_FOUND
                  meta:
                    type: object
                    properties:
                      self_listok_id:
                        type: integer
                        example: 1
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
    patch:
      summary: ''
      operationId: patchSyncV1CrmSelfListokId
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses: {  }
      tags:
        - 'CRM Hotel API'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                surname:
                  type: string
                  description: validation.max.
                  example: b
                firstname:
                  type: string
                  description: validation.max.
                  example: 'n'
                id_citizen:
                  type: integer
                  description: validation.min.
                  example: 67
                passportNumber:
                  type: string
                  description: validation.max.
                  example: z
                datePassport:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                sex:
                  type: string
                  description: ''
                  example: W
                  enum:
                    - M
                    - W
                id_visittype:
                  type: integer
                  description: validation.min.
                  example: 27
                id_guest:
                  type: integer
                  description: validation.min.
                  example: 35
                datevisiton:
                  type: string
                  description: validation.date.
                  example: '2026-09-02T14:28:55'
                wdays:
                  type: integer
                  description: 'validation.min validation.max.'
                  example: 8
                kppNumber:
                  type: string
                  description: 'Номер КПП пересечения границы. validation.max.'
                  example: KPP-12345
                dateKPP:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                  nullable: true
                direction:
                  type: string
                  description: 'Маршрут поездки (свободный текст). validation.max.'
                  example: 'Tashkent → Samarkand'
                  nullable: true
                id_visatype:
                  type: integer
                  description: validation.min.
                  example: 60
                  nullable: true
                visaNumber:
                  type: string
                  description: validation.max.
                  example: d
                  nullable: true
                dateVisaOn:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                  nullable: true
                dateVisaOff:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2026-09-02'
                  nullable: true
                visaIssuedBy:
                  type: string
                  description: validation.max.
                  example: l
                  nullable: true
                children:
                  type: object
                  description: ''
                  example: null
                  properties: {  }
                crm_actor_id:
                  type: string
                  description: validation.max.
                  example: j
                  nullable: true
                crm_actor_name:
                  type: string
                  description: validation.max.
                  example: 'n'
                  nullable: true
      security: []
    parameters:
      -
        in: path
        name: id
        description: '`self_listok_id` из списка.'
        example: 8821934
        required: true
        schema:
          type: integer
  /sync/v1/crm/finance/tourist-tax:
    get:
      summary: "Сводка турсбора: помесячные суммы (ГТ/МТ/СТ) + итог. Разрез — по дате\n выезда, листки без выезда в суммы не входят."
      operationId: +
      description: ''
      parameters:
        -
          in: query
          name: year
          description: 'Год (обязательно). validation.min validation.max.'
          example: 2026
          required: true
          schema:
            type: integer
            description: 'Год (обязательно). validation.min validation.max.'
            example: 2026
        -
          in: query
          name: month
          description: 'Месяц 1..12. Без него — весь год с разбивкой по месяцам. validation.between.'
          example: 7
          required: false
          schema:
            type: integer
            description: 'Месяц 1..12. Без него — весь год с разбивкой по месяцам. validation.between.'
            example: 7
            nullable: true
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    year: 2026
                    month: 7
                    basis: checkout
                    months:
                      -
                        month: 7
                        listok_qty: 412
                        self_qty: 8
                        real_days: 1180
                        gt_sum: 17800000.0
                        mt_sum: 420000.0
                        st_sum: 230000.0
                        total: 18450000.0
                    total:
                      listok_qty: 412
                      self_qty: 8
                      real_days: 1180
                      gt_sum: 17800000.0
                      mt_sum: 420000.0
                      st_sum: 230000.0
                      total: 18450000.0
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      year:
                        type: integer
                        example: 2026
                      month:
                        type: integer
                        example: 7
                      basis:
                        type: string
                        example: checkout
                      months:
                        type: array
                        example:
                          -
                            month: 7
                            listok_qty: 412
                            self_qty: 8
                            real_days: 1180
                            gt_sum: 17800000
                            mt_sum: 420000
                            st_sum: 230000
                            total: 18450000
                        items:
                          type: object
                          properties:
                            month:
                              type: integer
                              example: 7
                            listok_qty:
                              type: integer
                              example: 412
                            self_qty:
                              type: integer
                              example: 8
                            real_days:
                              type: integer
                              example: 1180
                            gt_sum:
                              type: number
                              example: 17800000.0
                            mt_sum:
                              type: number
                              example: 420000.0
                            st_sum:
                              type: number
                              example: 230000.0
                            total:
                              type: number
                              example: 18450000.0
                      total:
                        type: object
                        properties:
                          listok_qty:
                            type: integer
                            example: 412
                          self_qty:
                            type: integer
                            example: 8
                          real_days:
                            type: integer
                            example: 1180
                          gt_sum:
                            type: number
                            example: 17800000.0
                          mt_sum:
                            type: number
                            example: 420000.0
                          st_sum:
                            type: number
                            example: 230000.0
                          total:
                            type: number
                            example: 18450000.0
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
  /sync/v1/crm/finance/tourist-tax/details:
    get:
      summary: "Детализация турсбора за месяц: построчно по гостям (гостиничные и\n самостоятельные регистрации), с пагинацией."
      operationId: ''
      description: ''
      parameters:
        -
          in: query
          name: year
          description: 'Год (обязательно). validation.min validation.max.'
          example: 2026
          required: true
          schema:
            type: integer
            description: 'Год (обязательно). validation.min validation.max.'
            example: 2026
        -
          in: query
          name: month
          description: 'Месяц 1..12 (обязательно). validation.between.'
          example: 7
          required: true
          schema:
            type: integer
            description: 'Месяц 1..12 (обязательно). validation.between.'
            example: 7
        -
          in: query
          name: page
          description: 'Номер страницы (с 1). validation.min.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'Номер страницы (с 1). validation.min.'
            example: 1
            nullable: true
        -
          in: query
          name: per_page
          description: 'Размер страницы (1..200, по умолчанию 50). validation.min validation.max.'
          example: 50
          required: false
          schema:
            type: integer
            description: 'Размер страницы (1..200, по умолчанию 50). validation.min validation.max.'
            example: 50
            nullable: true
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    total: 420
                    page: 1
                    per_page: 50
                    items:
                      -
                        source: listok
                        listok_id: 8826912
                        regNum: 1726-2026-00012345
                        surname: MUSTERMANN
                        firstname: MAX
                        lastname: null
                        id_citizen: 5
                        citizenship: Германия
                        is_local: false
                        datevisiton: '2026-07-01 14:00:00'
                        datevisitoff: '2026-07-05 10:00:00'
                        days: 4
                        prc: 5.0
                        mzrp: 412000.0
                        tax_sum: 82400.0
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 420
                      page:
                        type: integer
                        example: 1
                      per_page:
                        type: integer
                        example: 50
                      items:
                        type: array
                        example:
                          -
                            source: listok
                            listok_id: 8826912
                            regNum: 1726-2026-00012345
                            surname: MUSTERMANN
                            firstname: MAX
                            lastname: null
                            id_citizen: 5
                            citizenship: Германия
                            is_local: false
                            datevisiton: '2026-07-01 14:00:00'
                            datevisitoff: '2026-07-05 10:00:00'
                            days: 4
                            prc: 5
                            mzrp: 412000
                            tax_sum: 82400
                        items:
                          type: object
                          properties:
                            source:
                              type: string
                              example: listok
                            listok_id:
                              type: integer
                              example: 8826912
                            regNum:
                              type: string
                              example: 1726-2026-00012345
                            surname:
                              type: string
                              example: MUSTERMANN
                            firstname:
                              type: string
                              example: MAX
                            lastname:
                              type: string
                              example: null
                            id_citizen:
                              type: integer
                              example: 5
                            citizenship:
                              type: string
                              example: Германия
                            is_local:
                              type: boolean
                              example: false
                            datevisiton:
                              type: string
                              example: '2026-07-01 14:00:00'
                            datevisitoff:
                              type: string
                              example: '2026-07-05 10:00:00'
                            days:
                              type: integer
                              example: 4
                            prc:
                              type: number
                              example: 5.0
                            mzrp:
                              type: number
                              example: 412000.0
                            tax_sum:
                              type: number
                              example: 82400.0
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
  /sync/v1/crm/finance/subscription:
    get:
      summary: "Абонентская плата: начисления (тариф, скидка, к оплате, регистраций),\n оплаты за период и текущий баланс гостиницы."
      operationId: ''
      description: ''
      parameters:
        -
          in: query
          name: year
          description: 'Год (обязательно). validation.min validation.max.'
          example: 2026
          required: true
          schema:
            type: integer
            description: 'Год (обязательно). validation.min validation.max.'
            example: 2026
        -
          in: query
          name: month
          description: 'Месяц 1..12. Без него — весь год с разбивкой по месяцам. validation.between.'
          example: 7
          required: false
          schema:
            type: integer
            description: 'Месяц 1..12. Без него — весь год с разбивкой по месяцам. validation.between.'
            example: 7
            nullable: true
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    year: 2026
                    month: 7
                    accruals:
                      -
                        period: 2026-07
                        tariff: 500000.0
                        discount_percent: 0.0
                        total: 500000.0
                        registrations: 42
                        accrued_at: '2026-08-01 03:00:00'
                    accrued_total: 500000.0
                    payments_total: 250000.0
                    current_deposit: 1500000.0
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      year:
                        type: integer
                        example: 2026
                      month:
                        type: integer
                        example: 7
                      accruals:
                        type: array
                        example:
                          -
                            period: 2026-07
                            tariff: 500000
                            discount_percent: 0
                            total: 500000
                            registrations: 42
                            accrued_at: '2026-08-01 03:00:00'
                        items:
                          type: object
                          properties:
                            period:
                              type: string
                              example: 2026-07
                            tariff:
                              type: number
                              example: 500000.0
                            discount_percent:
                              type: number
                              example: 0.0
                            total:
                              type: number
                              example: 500000.0
                            registrations:
                              type: integer
                              example: 42
                            accrued_at:
                              type: string
                              example: '2026-08-01 03:00:00'
                      accrued_total:
                        type: number
                        example: 500000.0
                      payments_total:
                        type: number
                        example: 250000.0
                      current_deposit:
                        type: number
                        example: 1500000.0
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
  /sync/v1/crm/finance/registrations:
    get:
      summary: 'Подсчёт регистраций по дате заезда: за год — помесячно, за месяц — по дням.'
      operationId: ''
      description: ''
      parameters:
        -
          in: query
          name: year
          description: 'Год (обязательно). validation.min validation.max.'
          example: 2026
          required: true
          schema:
            type: integer
            description: 'Год (обязательно). validation.min validation.max.'
            example: 2026
        -
          in: query
          name: month
          description: 'Месяц 1..12. Без него — весь год с разбивкой по месяцам. validation.between.'
          example: 7
          required: false
          schema:
            type: integer
            description: 'Месяц 1..12. Без него — весь год с разбивкой по месяцам. validation.between.'
            example: 7
            nullable: true
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: OK
                  data:
                    year: 2026
                    month: 7
                    basis: checkin
                    items:
                      -
                        day: 1
                        listok_qty: 14
                        self_qty: 1
                        total: 15
                      -
                        day: 2
                        listok_qty: 9
                        self_qty: 0
                        total: 9
                    total:
                      listok_qty: 412
                      self_qty: 8
                      total: 420
                  request_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: OK
                  data:
                    type: object
                    properties:
                      year:
                        type: integer
                        example: 2026
                      month:
                        type: integer
                        example: 7
                      basis:
                        type: string
                        example: checkin
                      items:
                        type: array
                        example:
                          -
                            day: 1
                            listok_qty: 14
                            self_qty: 1
                            total: 15
                          -
                            day: 2
                            listok_qty: 9
                            self_qty: 0
                            total: 9
                        items:
                          type: object
                          properties:
                            day:
                              type: integer
                              example: 1
                            listok_qty:
                              type: integer
                              example: 14
                            self_qty:
                              type: integer
                              example: 1
                            total:
                              type: integer
                              example: 15
                      total:
                        type: object
                        properties:
                          listok_qty:
                            type: integer
                            example: 412
                          self_qty:
                            type: integer
                            example: 8
                          total:
                            type: integer
                            example: 420
                  request_id:
                    type: string
                    example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      tags:
        - 'CRM Hotel API'
      security: []
  /sync/v1/coato/common:
    post:
      summary: 'COATO: Common hotels info by region/district code'
      operationId: cOATOCommonHotelsInfoByRegiondistrictCode
      description: 'Returns hotel list by SOATO/COATO code.'
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: success
                  data:
                    -
                      hotel_id: 123
                      hotel_district: Tashkent
                      hotel_name: 'Example Hotel'
                      hotel_type: Hotel
                      hotel_status: Active
                      hotel_stars: 3
                      hotel_inn: '123456789'
                      hotel_rooms: 10
                      hotel_beds: 20
                      hotel_address: 'Street 1'
                      hotel_local_qty: 5
                      hotel_foreign_qty: 2
                      hotel_phone: +998...
                      hotel_manager: 'Manager Name'
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d311
                properties:
                  code:
                    type: integer
                    example: 200
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: success
                    description: ''
                    enum: []
                  data:
                    type: array
                    example:
                      -
                        hotel_id: 123
                        hotel_district: Tashkent
                        hotel_name: 'Example Hotel'
                        hotel_type: Hotel
                        hotel_status: Active
                        hotel_stars: 3
                        hotel_inn: '123456789'
                        hotel_rooms: 10
                        hotel_beds: 20
                        hotel_address: 'Street 1'
                        hotel_local_qty: 5
                        hotel_foreign_qty: 2
                        hotel_phone: +998...
                        hotel_manager: 'Manager Name'
                    description: ''
                    enum: []
                    items:
                      type: object
                      properties:
                        hotel_id:
                          type: integer
                          example: 123
                        hotel_district:
                          type: string
                          example: Tashkent
                        hotel_name:
                          type: string
                          example: 'Example Hotel'
                        hotel_type:
                          type: string
                          example: Hotel
                        hotel_status:
                          type: string
                          example: Active
                        hotel_stars:
                          type: integer
                          example: 3
                        hotel_inn:
                          type: string
                          example: '123456789'
                        hotel_rooms:
                          type: integer
                          example: 10
                        hotel_beds:
                          type: integer
                          example: 20
                        hotel_address:
                          type: string
                          example: 'Street 1'
                        hotel_local_qty:
                          type: integer
                          example: 5
                        hotel_foreign_qty:
                          type: integer
                          example: 2
                        hotel_phone:
                          type: string
                          example: +998...
                        hotel_manager:
                          type: string
                          example: 'Manager Name'
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d311
                    description: ''
                    enum: []
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  message: 'Request time expired'
                  error_code: REQUEST_TIME_EXPIRED
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 401
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Request time expired'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: REQUEST_TIME_EXPIRED
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 403
                  message: 'Invalid signature hash'
                  error_code: INVALID_SIGNATURE
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 403
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Invalid signature hash'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: INVALID_SIGNATURE
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 422
                  message: 'Validation error'
                  error_code: VALIDATION_ERROR
                  meta:
                    field: date
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 422
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Validation error'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: VALIDATION_ERROR
                  meta:
                    type: object
                    properties:
                      field:
                        type: string
                        example: date
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 500
                  message: 'Internal error'
                  error_code: INTERNAL_ERROR
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 500
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Internal error'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: INTERNAL_ERROR
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
      tags:
        - 'Sync API'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                oblastsoatocode:
                  type: string
                  description: 'SOATO/COATO code.'
                  example: '"1726"'
              required:
                - oblastsoatocode
      security: []
  /sync/v1/coato/common-with-period:
    post:
      summary: 'COATO: Common hotels info by region/district code with period stats'
      operationId: cOATOCommonHotelsInfoByRegiondistrictCodeWithPeriodStats
      description: "Returns hotel list by COATO code with additional fields: location (geo),\ncheck_in_qty (arrivals count) and check_out_qty (departures count) for the given period.\n\nAccess restricted to specific API users (configured in `sync.mip.allowed_users`).\nOnly specific COATO codes are allowed (configured in `sync.mip.allowed_coato`).\nMaximum date interval is configurable (default: 7 days)."
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: success
                  data:
                    -
                      hotel_id: 123
                      hotel_district: 'Mirzo Ulugbek'
                      hotel_name: 'Example Hotel'
                      hotel_type: Hotel
                      hotel_status: Active
                      hotel_stars: 3
                      hotel_inn: '123456789'
                      hotel_rooms: 10
                      hotel_beds: 20
                      hotel_address: 'Street 1'
                      hotel_local_qty: 5
                      hotel_foreign_qty: 2
                      hotel_phone: +998...
                      hotel_manager: 'Manager Name'
                      location: '41.311081,69.279737'
                      check_in_qty: 15
                      check_out_qty: 8
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 200
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: success
                    description: ''
                    enum: []
                  data:
                    type: array
                    example:
                      -
                        hotel_id: 123
                        hotel_district: 'Mirzo Ulugbek'
                        hotel_name: 'Example Hotel'
                        hotel_type: Hotel
                        hotel_status: Active
                        hotel_stars: 3
                        hotel_inn: '123456789'
                        hotel_rooms: 10
                        hotel_beds: 20
                        hotel_address: 'Street 1'
                        hotel_local_qty: 5
                        hotel_foreign_qty: 2
                        hotel_phone: +998...
                        hotel_manager: 'Manager Name'
                        location: '41.311081,69.279737'
                        check_in_qty: 15
                        check_out_qty: 8
                    description: ''
                    enum: []
                    items:
                      type: object
                      properties:
                        hotel_id:
                          type: integer
                          example: 123
                        hotel_district:
                          type: string
                          example: 'Mirzo Ulugbek'
                        hotel_name:
                          type: string
                          example: 'Example Hotel'
                        hotel_type:
                          type: string
                          example: Hotel
                        hotel_status:
                          type: string
                          example: Active
                        hotel_stars:
                          type: integer
                          example: 3
                        hotel_inn:
                          type: string
                          example: '123456789'
                        hotel_rooms:
                          type: integer
                          example: 10
                        hotel_beds:
                          type: integer
                          example: 20
                        hotel_address:
                          type: string
                          example: 'Street 1'
                        hotel_local_qty:
                          type: integer
                          example: 5
                        hotel_foreign_qty:
                          type: integer
                          example: 2
                        hotel_phone:
                          type: string
                          example: +998...
                        hotel_manager:
                          type: string
                          example: 'Manager Name'
                        location:
                          type: string
                          example: '41.311081,69.279737'
                        check_in_qty:
                          type: integer
                          example: 15
                        check_out_qty:
                          type: integer
                          example: 8
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  message: 'Request time expired'
                  error_code: REQUEST_TIME_EXPIRED
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 401
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Request time expired'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: REQUEST_TIME_EXPIRED
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 403
                  message: 'Access denied for this user'
                  error_code: ACCESS_DENIED
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 403
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Access denied for this user'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: ACCESS_DENIED
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 422
                  message: 'Validation error'
                  error_code: VALIDATION_ERROR
                  meta:
                    field: date_from
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 422
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Validation error'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: VALIDATION_ERROR
                  meta:
                    type: object
                    properties:
                      field:
                        type: string
                        example: date_from
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 500
                  message: 'Internal error'
                  error_code: INTERNAL_ERROR
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 500
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Internal error'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: INTERNAL_ERROR
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
      tags:
        - 'Sync API'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                oblastsoatocode:
                  type: string
                  description: 'SOATO/COATO district code (must be in allowed list).'
                  example: '"1726269"'
                date_from:
                  type: string
                  description: 'Start date (Y-m-d).'
                  example: '"2026-04-01"'
                date_to:
                  type: string
                  description: 'End date (Y-m-d).'
                  example: '"2026-04-07"'
              required:
                - oblastsoatocode
                - date_from
                - date_to
      security: []
  /sync/v1/coato/details:
    post:
      summary: 'COATO: Details (check-in/check-out lists)'
      operationId: cOATODetailscheckIncheckOutLists
      description: 'Returns two arrays: `check_in` and `check_out` for the given date and COATO code.'
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: success
                  data:
                    check_out:
                      -
                        hotel_id: 1
                        listok_id: 10
                        name: 'John Doe'
                        sex: M
                        birthdate: '1990-01-01'
                        birthcountry: 860
                        arrival_from: 643
                        citizen: 860
                        check_in: '2026-01-18 12:00:00'
                        check_out: '2026-01-20 09:00:00'
                        children: null
                    check_in:
                      -
                        hotel_id: 2
                        listok_id: 11
                        name: 'Jane Doe'
                        sex: W
                        birthdate: '1995-05-05'
                        birthcountry: 860
                        arrival_from: 398
                        citizen: 860
                        check_in: '2026-01-20 14:00:00'
                        check_out: null
                        children: null
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 200
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: success
                    description: ''
                    enum: []
                  data:
                    type: object
                    properties:
                      check_out:
                        type: array
                        example:
                          -
                            hotel_id: 1
                            listok_id: 10
                            name: 'John Doe'
                            sex: M
                            birthdate: '1990-01-01'
                            birthcountry: 860
                            arrival_from: 643
                            citizen: 860
                            check_in: '2026-01-18 12:00:00'
                            check_out: '2026-01-20 09:00:00'
                            children: null
                        items:
                          type: object
                          properties:
                            hotel_id:
                              type: integer
                              example: 1
                            listok_id:
                              type: integer
                              example: 10
                            name:
                              type: string
                              example: 'John Doe'
                            sex:
                              type: string
                              example: M
                            birthdate:
                              type: string
                              example: '1990-01-01'
                            birthcountry:
                              type: integer
                              example: 860
                            arrival_from:
                              type: integer
                              example: 643
                            citizen:
                              type: integer
                              example: 860
                            check_in:
                              type: string
                              example: '2026-01-18 12:00:00'
                            check_out:
                              type: string
                              example: '2026-01-20 09:00:00'
                            children:
                              type: string
                              example: null
                      check_in:
                        type: array
                        example:
                          -
                            hotel_id: 2
                            listok_id: 11
                            name: 'Jane Doe'
                            sex: W
                            birthdate: '1995-05-05'
                            birthcountry: 860
                            arrival_from: 398
                            citizen: 860
                            check_in: '2026-01-20 14:00:00'
                            check_out: null
                            children: null
                        items:
                          type: object
                          properties:
                            hotel_id:
                              type: integer
                              example: 2
                            listok_id:
                              type: integer
                              example: 11
                            name:
                              type: string
                              example: 'Jane Doe'
                            sex:
                              type: string
                              example: W
                            birthdate:
                              type: string
                              example: '1995-05-05'
                            birthcountry:
                              type: integer
                              example: 860
                            arrival_from:
                              type: integer
                              example: 398
                            citizen:
                              type: integer
                              example: 860
                            check_in:
                              type: string
                              example: '2026-01-20 14:00:00'
                            check_out:
                              type: string
                              example: null
                            children:
                              type: string
                              example: null
                    description: ''
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  message: 'Request time expired'
                  error_code: REQUEST_TIME_EXPIRED
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 401
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Request time expired'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: REQUEST_TIME_EXPIRED
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 403
                  message: 'Invalid signature hash'
                  error_code: INVALID_SIGNATURE
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 403
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Invalid signature hash'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: INVALID_SIGNATURE
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 422
                  message: 'Validation error'
                  error_code: VALIDATION_ERROR
                  meta:
                    field: date
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 422
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Validation error'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: VALIDATION_ERROR
                  meta:
                    type: object
                    properties:
                      field:
                        type: string
                        example: date
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 500
                  message: 'Internal error'
                  error_code: INTERNAL_ERROR
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 500
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Internal error'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: INTERNAL_ERROR
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
      tags:
        - 'Sync API'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                oblastsoatocode:
                  type: string
                  description: 'SOATO/COATO code.'
                  example: '"1726"'
                date:
                  type: string
                  description: 'Date (Y-m-d).'
                  example: '"2026-01-20"'
              required:
                - oblastsoatocode
                - date
      security: []
  /sync/v1/hp/hotels:
    post:
      summary: 'Hisob Palata: Hotels list (paged)'
      operationId: hisobPalataHotelsListpaged
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"code\": 200,\n  \"message\": \"success\",\n  \"data\": {\n    \"total_count\": 1000,\n    \"rows\": [\n      {\"hotel_id\":1,\"hotel_name\":\"Example\",\"hotel_inn\":\"123\",\"hotel_type\":\"Hotel\",\"hotel_status\":\"Active\",\"hotel_stars\":3,\"hotel_rooms\":10,\"hotel_beds\":20,\"region_id\":\"17\",\"region_name\":\"Tashkent\",\"district_id\":\"1726\",\"district_name\":\"District\",\"hotel_address\":\"Street 1\",\"hotel_local_qty\":5,\"hotel_foreign_qty\":2,\"hotel_manager\":\"Manager\",\"hotel_phone\":\"+998...\"},\n    ]\n  },\n  \"request_id\": \"e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31\""
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  message: 'Request time expired'
                  error_code: REQUEST_TIME_EXPIRED
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 401
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Request time expired'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: REQUEST_TIME_EXPIRED
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 403
                  message: 'Invalid signature hash'
                  error_code: INVALID_SIGNATURE
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 403
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Invalid signature hash'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: INVALID_SIGNATURE
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 422
                  message: 'Validation error'
                  error_code: VALIDATION_ERROR
                  meta:
                    field: date
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 422
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Validation error'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: VALIDATION_ERROR
                  meta:
                    type: object
                    properties:
                      field:
                        type: string
                        example: date
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        500:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n   \"code\": 500,\n   \"message\": \"Internal error\",\n   \"error_code\": \"INTERNAL_ERROR\",\n   \"meta\": {},\n   \"request_id\": \"e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31\"\n }}"
      tags:
        - 'Sync API'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                page:
                  type: integer
                  description: 'Page number (1..).'
                  example: 1
                per_page:
                  type: integer
                  description: 'Per page (1..500).'
                  example: 50
              required:
                - page
                - per_page
      security: []
  /sync/v1/hp/clients:
    post:
      summary: 'Hisob Palata: Clients list (paged)'
      operationId: hisobPalataClientsListpaged
      description: ''
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: success
                  data:
                    total_count: 12345
                    rows:
                      -
                        listok_id: 1
                        hotel_id: 10
                        hotel_inn: '123'
                        hotel_name: Example
                        name: 'DOE JOHN'
                        pinfl: '**masked**'
                        gender: M
                        birthdate: '1990-01-01'
                        birthcountry: Uzbekistan
                        arrival_from: Kazakhstan
                        citizen: Uzbekistan
                        check_in: '2026-01-10 12:00:00'
                        check_out: '2026-01-12 09:00:00'
                        children: null
                        region_id: '17'
                        region_name: Tashkent
                        district_id: '1726'
                        district_name: District
                        guest_goal: Tourism
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 200
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: success
                    description: ''
                    enum: []
                  data:
                    type: object
                    properties:
                      total_count:
                        type: integer
                        example: 12345
                      rows:
                        type: array
                        example:
                          -
                            listok_id: 1
                            hotel_id: 10
                            hotel_inn: '123'
                            hotel_name: Example
                            name: 'DOE JOHN'
                            pinfl: '**masked**'
                            gender: M
                            birthdate: '1990-01-01'
                            birthcountry: Uzbekistan
                            arrival_from: Kazakhstan
                            citizen: Uzbekistan
                            check_in: '2026-01-10 12:00:00'
                            check_out: '2026-01-12 09:00:00'
                            children: null
                            region_id: '17'
                            region_name: Tashkent
                            district_id: '1726'
                            district_name: District
                            guest_goal: Tourism
                        items:
                          type: object
                          properties:
                            listok_id:
                              type: integer
                              example: 1
                            hotel_id:
                              type: integer
                              example: 10
                            hotel_inn:
                              type: string
                              example: '123'
                            hotel_name:
                              type: string
                              example: Example
                            name:
                              type: string
                              example: 'DOE JOHN'
                            pinfl:
                              type: string
                              example: '**masked**'
                            gender:
                              type: string
                              example: M
                            birthdate:
                              type: string
                              example: '1990-01-01'
                            birthcountry:
                              type: string
                              example: Uzbekistan
                            arrival_from:
                              type: string
                              example: Kazakhstan
                            citizen:
                              type: string
                              example: Uzbekistan
                            check_in:
                              type: string
                              example: '2026-01-10 12:00:00'
                            check_out:
                              type: string
                              example: '2026-01-12 09:00:00'
                            children:
                              type: string
                              example: null
                            region_id:
                              type: string
                              example: '17'
                            region_name:
                              type: string
                              example: Tashkent
                            district_id:
                              type: string
                              example: '1726'
                            district_name:
                              type: string
                              example: District
                            guest_goal:
                              type: string
                              example: Tourism
                    description: ''
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  message: 'Request time expired'
                  error_code: REQUEST_TIME_EXPIRED
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 401
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Request time expired'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: REQUEST_TIME_EXPIRED
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        403:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 403
                  message: 'Invalid signature hash'
                  error_code: INVALID_SIGNATURE
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 403
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Invalid signature hash'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: INVALID_SIGNATURE
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 422
                  message: 'Validation error'
                  error_code: VALIDATION_ERROR
                  meta:
                    field: date
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 422
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Validation error'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: VALIDATION_ERROR
                  meta:
                    type: object
                    properties:
                      field:
                        type: string
                        example: date
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 500
                  message: 'Internal error'
                  error_code: INTERNAL_ERROR
                  meta: {  }
                  request_id: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                properties:
                  code:
                    type: integer
                    example: 500
                    description: ''
                    enum: []
                  message:
                    type: string
                    example: 'Internal error'
                    description: ''
                    enum: []
                  error_code:
                    type: string
                    example: INTERNAL_ERROR
                  meta:
                    type: object
                    properties: {  }
                  request_id:
                    type: string
                    example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
                    description: ''
                    enum: []
      tags:
        - 'Sync API'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                page:
                  type: integer
                  description: 'Page number (1..).'
                  example: 1
                per_page:
                  type: integer
                  description: 'Per page (1..500).'
                  example: 50
                date_from:
                  type: string
                  description: 'Start date (Y-m-d).'
                  example: '"2026-01-01"'
                date_to:
                  type: string
                  description: 'End date (Y-m-d).'
                  example: '"2026-01-31"'
              required:
                - page
                - per_page
                - date_from
                - date_to
      security: []
  /sync/v1/meta/errors:
    get:
      summary: 'Errors catalog'
      operationId: errorsCatalog
      description: "Полный список публичных error_code, возвращаемых Sync API и CRM Hotel API.\nКаждая запись содержит группу (auth / authz / idempotency / crm.hotel / crm.listok /\ncrm.assets / system), HTTP-статус, машиночитаемый error_code и краткое описание.\n\nИсточник правды — `App\\Support\\ErrorCatalog::all()`. Расширение списка считается\nобратно-совместимым изменением и не требует версионирования."
      parameters:
        -
          in: header
          name: X-User-Name
          description: ''
          example: apistatuser@emehmon.uz
          schema:
            type: string
        -
          in: header
          name: X-User-Ts
          description: ''
          example: '1769053020'
          schema:
            type: string
        -
          in: header
          name: X-User-Request-Id
          description: ''
          example: e7b8c3a4-9f2d-4c6a-8e51-6a9b2c4f7d31
          schema:
            type: string
        -
          in: header
          name: X-User-Hash
          description: ''
          example: PLACEHOLDER_HASH
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 200
                  message: success
                  data:
                    -
                      group: auth
                      http: 401
                      error_code: MISSING_AUTH_HEADERS
                      message: 'Missing authentication headers'
                    -
                      group: authz
                      http: 403
                      error_code: HOTEL_MISMATCH
                      message: 'Requested hotel does not match API user'
                    -
                      group: crm.listok
                      http: 422
                      error_code: LISTOK_DUPLICATE_ACTIVE
                      message: 'Active listok for this passport already exists in this hotel'
                properties:
                  code:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: success
                  data:
                    type: array
                    example:
                      -
                        group: auth
                        http: 401
                        error_code: MISSING_AUTH_HEADERS
                        message: 'Missing authentication headers'
                      -
                        group: authz
                        http: 403
                        error_code: HOTEL_MISMATCH
                        message: 'Requested hotel does not match API user'
                      -
                        group: crm.listok
                        http: 422
                        error_code: LISTOK_DUPLICATE_ACTIVE
                        message: 'Active listok for this passport already exists in this hotel'
                    items:
                      type: object
                      properties:
                        group:
                          type: string
                          example: auth
                        http:
                          type: integer
                          example: 401
                        error_code:
                          type: string
                          example: MISSING_AUTH_HEADERS
                        message:
                          type: string
                          example: 'Missing authentication headers'
      tags:
        - 'Sync API Meta'
      security: []
