openapi: 3.0.2
info:
  title: API parser-api.com pb.nalog.ru
  description: Документация API parser-api.com для работы с pb.nalog.ru.
  version: 1.0.0
servers:
  - url: https://parser-api.com/parser/nalog_pb_api
tags:
  - name: Основные запросы
    description: Основные запросы к сервису позволяют автоматизировать поиск на сайте pb.nalog.ru. Все запросы требуют указания ключа доступа (`key`).

paths:
  /search_ip:
    get:
      tags:
        - Основные запросы
      summary: Поиск по индивидуальным предпринимателям (ИП)
      description: Выполняет поиск информации об индивидуальных предпринимателях по ИНН.
      parameters:
        - name: key
          in: query
          required: true
          schema:
            type: string
          description: Ключ доступа (обязательный)
        - name: inn
          in: query
          required: true
          schema:
            type: string
          description: ИНН индивидуального предпринимателя (обязательный)
      responses:
        '200':
          description: Успешный ответ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchIpResponse'
        '400':
          description: Ошибка валидации запроса.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '403':
          description: Ошибка доступа.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'

  /search_org:
    get:
      tags:
        - Основные запросы
      summary: Поиск по организациям (ЮЛ)
      description: Выполняет поиск информации о юридических лицах по ИНН.
      parameters:
        - name: key
          in: query
          required: true
          schema:
            type: string
          description: Ключ доступа (обязательный)
        - name: inn
          in: query
          required: true
          schema:
            type: string
          description: ИНН юридического лица (обязательный)
      responses:
        '200':
          description: Успешный ответ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchOrgResponse'
        '400':
          description: Ошибка валидации запроса.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '403':
          description: Ошибка доступа.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'

  /search_fiz:
    get:
      tags:
        - Основные запросы
      summary: Поиск по руководителям и учредителям юридических лиц
      description: Выполняет поиск информации о физических лицах, являющихся руководителями или учредителями юридических лиц, по ИНН.
      parameters:
        - name: key
          in: query
          required: true
          schema:
            type: string
          description: Ключ доступа (обязательный)
        - name: inn
          in: query
          required: true
          schema:
            type: string
          description: ИНН физического лица (обязательный)
      responses:
        '200':
          description: Успешный ответ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchFizResponse'
        '400':
          description: Ошибка валидации запроса.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '403':
          description: Ошибка доступа.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'

  /search_dis:
    get:
      tags:
        - Основные запросы
      summary: Поиск по реестру дисквалифицированных лиц
      description: Выполняет поиск информации в реестре дисквалифицированных лиц по ФИО.
      parameters:
        - name: key
          in: query
          required: true
          schema:
            type: string
          description: Ключ доступа (обязательный)
        - name: fio
          in: query
          required: true
          schema:
            type: string
          description: ФИО дисквалифицированного лица (обязательный, рекомендуется использовать URL-кодирование)
      responses:
        '200':
          description: Успешный ответ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchDisResponse'
        '400':
          description: Ошибка валидации запроса.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '403':
          description: Ошибка доступа.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'

  /search_limit_org:
    get:
      tags:
        - Основные запросы
      summary: Поиск по ограничениям в юридических лицах
      description: Выполняет поиск информации об ограничениях, связанных с юридическими лицами, по ИНН.
      parameters:
        - name: key
          in: query
          required: true
          schema:
            type: string
          description: Ключ доступа (обязательный)
        - name: inn
          in: query
          required: true
          schema:
            type: string
          description: ИНН физического лица (обязательный)
      responses:
        '200':
          description: Успешный ответ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchLimitOrgResponse'
        '400':
          description: Ошибка валидации запроса.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '403':
          description: Ошибка доступа.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'

components:
  schemas:
    SearchIpResponse:
      type: object
      properties:
        success:
          type: integer
          description: Флаг успешности выполнения запроса, 1/0
          example: 1
        ip:
          type: array
          description: Массив найденных записей об индивидуальных предпринимателях
          items:
            type: object
            properties:
              ogrn:
                type: string
                description: ОГРН
                example: "319470400052172"
              inn:
                type: string
                description: ИНН
                example: "470700161305"
              okved:
                type: string
                description: Код ОКВЭД
                example: "47.29"
              okved_name:
                type: string
                description: Наименование ОКВЭД
                example: "Торговля розничная прочими пищевыми продуктами в специализированных магазинах"
              name:
                type: string
                description: ФИО индивидуального предпринимателя
                example: "АВАНЕСЯН ВАЗГЕН ИВАНИ"
              status:
                type: string
                description: Статус
                example: "Действующее"

    SearchOrgResponse:
      type: object
      properties:
        success:
          type: integer
          description: Флаг успешности выполнения запроса, 1/0
          example: 1
        org:
          type: array
          description: Массив найденных организаций
          items:
            type: object
            properties:
              inn:
                type: string
                description: ИНН
                example: "7743225906"
              okved:
                type: string
                description: Код ОКВЭД
                example: "43.12"
              okved_name:
                type: string
                description: Наименование ОКВЭД
                example: "Подготовка строительной площадки"
              name:
                type: string
                description: Полное наименование ЮЛ
                example: "ОБЩЕСТВО С ОГРАНИЧЕННОЙ ОТВЕТСТВЕННОСТЬЮ \"ВЕЛЕС\""
              name_short:
                type: string
                description: Краткое наименование ЮЛ
                example: "ООО \"ВЕЛЕС\""
              address:
                type: string
                description: Юридический адрес
                example: "125315, Г.МОСКВА, ПР-КТ ЛЕНИНГРАДСКИЙ, Д. 80, К. Г, Э/П/К/ОФ ТЕХ/XII/13/А3Д"
              status:
                type: string
                description: Статус
                example: "Действующее"

    SearchFizResponse:
      type: object
      properties:
        success:
          type: integer
          description: Флаг успешности выполнения запроса, 1/0
          example: 1
        director:
          type: array
          description: Массив найденных руководителей
          items:
            type: object
            properties:
              inn:
                type: string
                description: ИНН
                example: "470700161305"
              name:
                type: string
                description: ФИО
                example: "АВАНЕСЯН ВАЗГЕН ИВАНИ"
              count:
                type: integer
                description: Количество компаний, в которых лицо является руководителем
                example: 1
        owner:
          type: array
          description: Массив найденных учредителей
          items:
            type: object
            properties:
              inn:
                type: string
                description: ИНН
                example: "470700161305"
              name:
                type: string
                description: ФИО
                example: "АВАНЕСЯН ВАЗГЕН ИВАНИ"
              count:
                type: integer
                description: Количество компаний, в которых лицо является учредителем
                example: 1

    SearchDisResponse:
      type: object
      properties:
        success:
          type: integer
          description: Флаг успешности выполнения запроса, 1/0
          example: 1
        dis:
          type: array
          description: Массив найденных записей о дисквалифицированных лицах
          items:
            type: object
            properties:
              number:
                type: string
                description: Номер записи в реестре
                example: "227700065344"
              name:
                type: string
                description: ФИО дисквалифицированного лица
                example: "ГОБУЗОВ ИВАН ЮРЬЕВИЧ"
              date_of_birth:
                type: string
                description: Дата рождения
                example: "1982-05-29"
              place_of_birth:
                type: string
                description: Место рождения
                example: "ГОРОД ХАБАРОВСК"
              name_org:
                type: string
                description: Организация
                example: "ОБЩЕСТВО С ОГРАНИЧЕННОЙ ОТВЕТСТВЕННОСТЬЮ \"БРИЗ\""
              position:
                type: string
                description: Должность
                example: "УЧРЕДИТЕЛЬ"
              article:
                type: string
                description: Статья КоАП РФ
                example: "Ч.5 СТ. 14.25 КОАП РФ"
              creator:
                type: string
                description: Орган, составивший протокол
                example: "МИФНС РОССИИ №46 ПО Г.МОСКВЕ"
              court:
                type: string
                description: Суд
                example: "СУ №164 РАЙОНА ЮЖНОЕ ТУШИНО ГОРОДА МОСКВЫ БАРАННИКОВА Е."
              period:
                type: string
                description: Период дисквалификации
                example: "2 г. 0 м. 0 д."
              start_date:
                type: string
                description: Дата начала дисквалификации
                example: "2022-06-15"
              end_date:
                type: string
                description: Дата окончания дисквалификации
                example: "2024-06-14"

    SearchLimitOrgResponse:
      type: object
      properties:
        success:
          type: integer
          description: Флаг успешности выполнения запроса, 1/0
          example: 1
        limit_org:
          type: array
          description: Массив найденных записей об ограничениях
          items:
            type: object
            properties:
              name:
                type: string
                description: ФИО
                example: "ПЕТОВ ИВАН АЛЕКСЕЕВИЧ"
              inn:
                type: string
                description: ИНН
                example: "860315573220"
              position:
                type: string
                description: Причастность к ЮЛ
                example: "Лицо, имеющее право без доверенности действовать от имени ООО \"НОРДЛАЙН\" - ДИРЕКТОР"
              reason:
                type: string
                description: Причина ограничения
                example: "Причастность к ЮЛ, в отношении которого в ЕГРЮЛ внесена запись о недостоверности сведений об адресе ЮЛ"
              start_date:
                type: string
                description: Дата начала действия ограничения
                example: "2021-01-27"
              end_date:
                type: string
                description: Дата окончания действия ограничения
                example: "2024-01-27"
              org_name:
                type: string
                description: Наименование ЮЛ
                example: "ОБЩЕСТВО С ОГРАНИЧЕННОЙ ОТВЕТСТВЕННОСТЬЮ \"НОРДЛАЙН\""
              org_inn:
                type: string
                description: ИНН ЮЛ
                example: "8603222777"

    Error400:
      type: object
      properties:
        error:
          type: string
          description: Текст ошибки
          example: "Field inn is required"
        error_code:
          type: integer
          description: Код ошибки
          example: 40001

    Error403:
      type: object
      properties:
        error:
          type: string
          description: Текст ошибки
          enum:
            - "Invalid access key"
            - "The subscription period has expired"
            - "Invalid IP"
            - "Day limit of requests exceeded"
            - "Month limit of requests exceeded"
        error_code:
          type: integer
          description: Код ошибки
          enum:
            - 40301
            - 40302
            - 40303
            - 40304
            - 40305
