{
  "components": {
    "schemas": {
      "AgentError": {
        "properties": {
          "error": {
            "description": "Описание на грешката.",
            "type": "string"
          },
          "errorCode": {
            "$ref": "#/components/schemas/ErrorCode"
          },
          "errorKind": {
            "$ref": "#/components/schemas/ErrorKind"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "AgentUpdateRequired": {
        "description": "Връща се с HTTP 426 когато cloud-ът изисква по-нова версия на агента. От този момент агентът отказва всяка заявка (с изключение на /api/health, /api/info и /api/shutdown) и сам отваря диалога за преинсталиране.",
        "properties": {
          "agentVersion": {
            "type": "string"
          },
          "downloadUrl": {
            "description": "Инсталаторът за текущата ОС; празен, ако cloud-ът още не е публикувал такъв.",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "requiredVersion": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "DebtPaymentItem": {
        "properties": {
          "datePayment": {
            "description": "Дата на плащането (ако има).",
            "format": "date",
            "nullable": true,
            "title": "Дата плащане",
            "type": "string"
          },
          "debtPeriod": {
            "description": "Период за който се отнася.",
            "nullable": true,
            "title": "Период",
            "type": "string"
          },
          "debtTypeName": {
            "description": "Текстово описание на типа задължение.",
            "title": "Вид задължение",
            "type": "string"
          },
          "documentDate": {
            "description": "ISO дата на издаване.",
            "format": "date",
            "nullable": true,
            "title": "Дата документ",
            "type": "string"
          },
          "documentNumber": {
            "description": "Идентификатор на документа.",
            "nullable": true,
            "title": "Документ №",
            "type": "string"
          },
          "documentType": {
            "description": "Тип на документа.",
            "nullable": true,
            "title": "Вид документ",
            "type": "string"
          },
          "dueAmount": {
            "description": "Първоначално начислена сума.",
            "format": "double",
            "title": "Дължима сума",
            "type": "number"
          },
          "dueDate": {
            "description": "Падеж на задължението.",
            "format": "date",
            "nullable": true,
            "title": "Падеж",
            "type": "string"
          },
          "outstandingAmount": {
            "description": "Неплатен остатък по главницата (0 / null когато е изцяло платен).",
            "format": "double",
            "nullable": true,
            "title": "Остатък",
            "type": "number"
          },
          "outstandingInterest": {
            "description": "Начислени лихви върху остатъка (0 / null когато няма лихви).",
            "format": "double",
            "nullable": true,
            "title": "Лихви",
            "type": "number"
          },
          "paidAllAmount": {
            "description": "Общо платено по обхватната група.",
            "format": "double",
            "title": "Общо платено",
            "type": "number"
          },
          "paidAmount": {
            "description": "Платена сума по този документ.",
            "format": "double",
            "title": "Погасено",
            "type": "number"
          },
          "paymentTypeName": {
            "description": "Тип плащане; празно за чисти задължения.",
            "nullable": true,
            "title": "Тип плащане",
            "type": "string"
          }
        },
        "required": [
          "debtTypeName",
          "dueAmount",
          "paidAmount",
          "paidAllAmount"
        ],
        "type": "object"
      },
      "DebtPaymentTypeItem": {
        "properties": {
          "code": {
            "description": "Кратък код, ако е наличен.",
            "nullable": true,
            "title": "Код",
            "type": "string"
          },
          "groupId": {
            "description": "Идентификатор / име на категорията към която принадлежи.",
            "nullable": true,
            "title": "Група",
            "type": "string"
          },
          "id": {
            "description": "Числов идентификатор на типа.",
            "title": "ID",
            "type": "string"
          },
          "name": {
            "description": "Човешко име на типа.",
            "title": "Наименование",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "DebtPaymentsRequest": {
        "properties": {
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "type": {
            "default": "0",
            "description": "0 = всички видове; друго = id от debt_payments_types",
            "title": "Вид",
            "type": "string"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year"
        ],
        "type": "object"
      },
      "DebtPaymentsResult": {
        "properties": {
          "error": {
            "description": "При status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "items": {
            "description": "Един ред на задължение или на плащане за избраното ЗЛ + година.",
            "items": {
              "$ref": "#/components/schemas/DebtPaymentItem"
            },
            "title": "Записи задължения/плащания",
            "type": "array"
          },
          "rowCount": {
            "description": "Брой върнати записи.",
            "format": "int64",
            "title": "Брой записи",
            "type": "integer"
          },
          "status": {
            "description": "ok при успех; error при проблем — текстът е в `error`.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "type": {
            "description": "TYPE филтър ('0' = всички).",
            "title": "Тип задължение",
            "type": "string"
          },
          "year": {
            "description": "Запитваната година.",
            "format": "int64",
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "status",
          "rowCount",
          "year",
          "type"
        ],
        "type": "object"
      },
      "DebtPaymentsTypesRequest": {
        "properties": {},
        "type": "object"
      },
      "DebtPaymentsTypesResult": {
        "properties": {
          "error": {
            "description": "При status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "items": {
            "description": "Глобална референтна таблица — еднаква за всички ЗЛ.",
            "items": {
              "$ref": "#/components/schemas/DebtPaymentTypeItem"
            },
            "title": "Типове задължения/плащания",
            "type": "array"
          },
          "rowCount": {
            "description": "Колко типа е върнал порталът.",
            "format": "int64",
            "title": "Брой записи",
            "type": "integer"
          },
          "status": {
            "description": "ok при успех; error при проблем — текстът е в `error`.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "items",
          "status",
          "rowCount"
        ],
        "type": "object"
      },
      "Dec16BatchItem": {
        "properties": {
          "dec1Path": {
            "description": "Пълен път до Д1 файла; празно когато периодът е само с Д6.",
            "nullable": true,
            "title": "Файл Д1",
            "type": "string"
          },
          "dec6Path": {
            "description": "Пълен път до Д6 файла; празно когато периодът е само с Д1.",
            "nullable": true,
            "title": "Файл Д6",
            "type": "string"
          },
          "documentId": {
            "description": "Идентификатор за dec1_6_result; празно при failed / skipped.",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК, прочетен от съдържанието на файла.",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП; празно при failed / skipped.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "message": {
            "description": "Причина за отказа или за пропускането.",
            "nullable": true,
            "title": "Съобщение",
            "type": "string"
          },
          "month": {
            "description": "Месец на периода (1-12).",
            "format": "int64",
            "title": "Месец",
            "type": "integer"
          },
          "status": {
            "description": "submitted — прието от НАП; failed — опитано и отказано; skipped — изобщо не е подавано (ЕИК извън токена или извън филтъра).",
            "enum": [
              "submitted",
              "failed",
              "skipped"
            ],
            "title": "Статус",
            "type": "string"
          },
          "year": {
            "description": "Година на периода.",
            "format": "int64",
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year",
          "month",
          "status"
        ],
        "type": "object"
      },
      "Dec16BatchRequest": {
        "properties": {
          "eik": {
            "description": "Само за тази фирма; празно = всички от токена.",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "fund": {
            "description": "true когато подаването е от осигурителна каса.",
            "title": "Осигурителна каса",
            "type": "boolean"
          },
          "month": {
            "default": "0",
            "description": "1-12; пропусни или 0 за цялата година.",
            "format": "int64",
            "title": "Месец",
            "type": "integer"
          },
          "recursive": {
            "default": "true",
            "description": "Сканира и подпапките. По подразбиране true.",
            "title": "Рекурсивно",
            "type": "boolean"
          },
          "rootFolder": {
            "description": "Папка с Д1/Д6 файловете.",
            "title": "Папка",
            "type": "string"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "rootFolder",
          "year"
        ],
        "type": "object"
      },
      "Dec16BatchResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "failed": {
            "description": "Брой отказани подавания.",
            "format": "int64",
            "title": "Неуспешни",
            "type": "integer"
          },
          "items": {
            "description": "По един ред на намерен период — подаден, отказан или пропуснат (виж `status` на реда).",
            "items": {
              "$ref": "#/components/schemas/Dec16BatchItem"
            },
            "title": "Периоди",
            "type": "array"
          },
          "skipped": {
            "description": "Брой периоди, които не са подавани.",
            "format": "int64",
            "title": "Пропуснати",
            "type": "integer"
          },
          "status": {
            "description": "ok когато всичко намерено е прието; partial при поне едно отказано или пропуснато; error когато нищо не е подадено (виж `error`).",
            "enum": [
              "ok",
              "partial",
              "error"
            ],
            "title": "Общ статус",
            "type": "string"
          },
          "submitted": {
            "description": "Брой успешно приети подавания.",
            "format": "int64",
            "title": "Подадени",
            "type": "integer"
          },
          "totalMatched": {
            "description": "Брой периоди, намерени за зададения филтър.",
            "format": "int64",
            "title": "Съответстващи",
            "type": "integer"
          },
          "totalScanned": {
            "description": "Брой .TXT файлове проверени.",
            "format": "int64",
            "title": "Общо сканирани",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "totalScanned",
          "totalMatched",
          "submitted",
          "failed",
          "skipped",
          "status"
        ],
        "type": "object"
      },
      "Dec16PortalFileItem": {
        "properties": {
          "content": {
            "description": "UTF-8 съдържание (декодирано от CP1251).",
            "title": "Съдържание",
            "type": "string"
          },
          "docFileId": {
            "description": "ID на подписания файл в портала.",
            "title": "File ID",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер на подаването.",
            "title": "Вх. номер",
            "type": "string"
          },
          "name": {
            "description": "Канонично име на файла (EMPL2021.TXT / NRA62007.TXT).",
            "title": "Име",
            "type": "string"
          },
          "period": {
            "description": "Период на декларацията — напр. „Март 2026\".",
            "title": "Период",
            "type": "string"
          },
          "submissionId": {
            "description": "ID на подаването, от което идва този файл.",
            "title": "Submission ID",
            "type": "string"
          },
          "submittedAt": {
            "description": "ISO-8601 timestamp от entryDate на подаването.",
            "title": "Подадено на",
            "type": "string"
          },
          "type": {
            "description": "dec1 / dec6.",
            "title": "Тип",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type",
          "docFileId",
          "content",
          "submissionId",
          "incomeNumber",
          "submittedAt",
          "period"
        ],
        "type": "object"
      },
      "Dec16PortalFilesRequest": {
        "properties": {
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "month": {
            "description": "Месец от периода (1-12).",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year"
        ],
        "type": "object"
      },
      "Dec16PortalFilesResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "fileCount": {
            "description": "Общ брой успешно изтеглени файлове.",
            "format": "int64",
            "nullable": true,
            "title": "Брой файлове",
            "type": "integer"
          },
          "files": {
            "description": "Изтеглени Д1 (EMPL2021) и Д6 (NRA62007) файлове за приетите декларации обр. 1 и 6. Без `month` идват файловете на всички приети подавания за годината. Дублираните приети подавания за един период остават видими (счетоводна грешка); всеки ред носи submissionId / incomeNumber / period.",
            "items": {
              "$ref": "#/components/schemas/Dec16PortalFileItem"
            },
            "title": "Файлове",
            "type": "array"
          },
          "status": {
            "description": "ok при успех; error при липсваща декларация или HTTP грешка.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "submissionCount": {
            "description": "Брой приети подавания в отговора. Дублираните приети подавания за един период се броят отделно (за да се види счетоводната грешка).",
            "format": "int64",
            "nullable": true,
            "title": "Брой подавания",
            "type": "integer"
          }
        },
        "required": [
          "files",
          "status"
        ],
        "type": "object"
      },
      "Dec16Request": {
        "properties": {
          "_inlineFile": {
            "$ref": "#/components/schemas/InlineFile",
            "description": "Алтернатива на X-Napi-File-Path: подайте съдържанието на файла директно в JSON-а (base64) вместо път до файл. TXT файл по образец Д1 (EMPL2021) или Д6. Инлайн подаването приема един файл и го третира като Д1 — за Д1 и Д6 заедно ползвайте dec1FilePath / dec6FilePath. На заявка се подава един период за един ЕИК; за цяла папка ползвайте `dec1_6_batch`, който сам намира и сдвоява Д1/Д6 по период. Файлът се записва под системния temp и се трие автоматично след handler-а."
          },
          "dec1FilePath": {
            "description": "Път до Д1 файл. Поне един от dec1FilePath / dec6FilePath е задължителен; ако са подадени и двата, трябва да са за един и същ ЕИК.",
            "title": "Файл Д1 (EMPL2021)",
            "type": "string"
          },
          "dec6FilePath": {
            "description": "Път до Д6 файл.",
            "title": "Файл Д6",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "fund": {
            "description": "true когато декларацията се подава от осигурителна каса. По подразбиране false (обикновено подаване).",
            "title": "Осигурителна каса",
            "type": "boolean"
          },
          "month": {
            "description": "Месец от периода (1-12).",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "year",
          "month"
        ],
        "type": "object"
      },
      "Dec16ResultRequest": {
        "properties": {
          "documentId": {
            "description": "ID на подадения документ — върнат от submit операцията като documentId.",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "eik"
        ],
        "type": "object"
      },
      "Dec16SubmissionResult": {
        "properties": {
          "documentId": {
            "description": "Идентификатор на документа в НАП (pid / DOCID).",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "errorMessage": {
            "description": "Свободен текст с описание на грешката, ако има такава.",
            "nullable": true,
            "title": "Съобщение за грешка",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Технически грешки върнати от REST API на НАП; празен масив при успех.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "title": "Native грешки",
            "type": "array"
          },
          "submissionDate": {
            "description": "Времеви маркер на подаването от страна на НАП.",
            "format": "date-time",
            "nullable": true,
            "title": "Дата на подаване",
            "type": "string"
          },
          "success": {
            "description": "true когато НАП прие декларацията.",
            "title": "Успех",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "Dec1FileItem": {
        "properties": {
          "content": {
            "description": "UTF-8 съдържание.",
            "title": "Съдържание",
            "type": "string"
          },
          "name": {
            "description": "Име на файла.",
            "title": "Име",
            "type": "string"
          },
          "path": {
            "description": "Пълен път (UTF-8).",
            "title": "Път",
            "type": "string"
          },
          "tin": {
            "description": "БУЛСТАТ от декларацията.",
            "title": "БУЛСТАТ",
            "type": "string"
          }
        },
        "required": [
          "name",
          "path",
          "tin",
          "content"
        ],
        "type": "object"
      },
      "Dec1FilesScanRequest": {
        "properties": {
          "month": {
            "default": "0",
            "description": "1-12; пропусни или 0 за цялата година.",
            "format": "int64",
            "title": "Месец",
            "type": "integer"
          },
          "recursive": {
            "default": "true",
            "description": "Сканира и подпапките. По подразбиране true.",
            "title": "Рекурсивно",
            "type": "boolean"
          },
          "rootFolder": {
            "description": "Папка за рекурсивно сканиране.",
            "title": "Папка",
            "type": "string"
          },
          "year": {
            "description": "Година за филтриране на файловете.",
            "format": "int64",
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "rootFolder",
          "year"
        ],
        "type": "object"
      },
      "Dec1FilesScanResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "files": {
            "description": "Открити Д1 декларации за подадения период.",
            "items": {
              "$ref": "#/components/schemas/Dec1FileItem"
            },
            "title": "Файлове",
            "type": "array"
          },
          "status": {
            "description": "ok при успех; error при проблем.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "totalMatched": {
            "description": "Брой файлове в зададения период.",
            "format": "int64",
            "title": "Съответстващи",
            "type": "integer"
          },
          "totalScanned": {
            "description": "Брой .TXT файлове проверени.",
            "format": "int64",
            "title": "Общо сканирани",
            "type": "integer"
          }
        },
        "required": [
          "files",
          "totalScanned",
          "totalMatched",
          "status"
        ],
        "type": "object"
      },
      "Dec6FileItem": {
        "properties": {
          "content": {
            "description": "UTF-8 съдържание.",
            "title": "Съдържание",
            "type": "string"
          },
          "name": {
            "description": "Име на файла.",
            "title": "Име",
            "type": "string"
          },
          "path": {
            "description": "Пълен път (UTF-8).",
            "title": "Път",
            "type": "string"
          },
          "tin": {
            "description": "БУЛСТАТ от декларацията.",
            "title": "БУЛСТАТ",
            "type": "string"
          }
        },
        "required": [
          "name",
          "path",
          "tin",
          "content"
        ],
        "type": "object"
      },
      "Dec6FilesScanRequest": {
        "properties": {
          "month": {
            "default": "0",
            "description": "1-12; пропусни или 0 за цялата година.",
            "format": "int64",
            "title": "Месец",
            "type": "integer"
          },
          "recursive": {
            "default": "true",
            "description": "Сканира и подпапките. По подразбиране true.",
            "title": "Рекурсивно",
            "type": "boolean"
          },
          "rootFolder": {
            "description": "Папка за рекурсивно сканиране.",
            "title": "Папка",
            "type": "string"
          },
          "year": {
            "description": "Година за филтриране на файловете.",
            "format": "int64",
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "rootFolder",
          "year"
        ],
        "type": "object"
      },
      "Dec6FilesScanResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "files": {
            "description": "Открити Д6 декларации за подадения период.",
            "items": {
              "$ref": "#/components/schemas/Dec6FileItem"
            },
            "title": "Файлове",
            "type": "array"
          },
          "status": {
            "description": "ok при успех; error при проблем.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "totalMatched": {
            "description": "Брой файлове в зададения период.",
            "format": "int64",
            "title": "Съответстващи",
            "type": "integer"
          },
          "totalScanned": {
            "description": "Брой .TXT файлове проверени.",
            "format": "int64",
            "title": "Общо сканирани",
            "type": "integer"
          }
        },
        "required": [
          "files",
          "totalScanned",
          "totalMatched",
          "status"
        ],
        "type": "object"
      },
      "Dec731Request": {
        "properties": {
          "_inlineFile": {
            "$ref": "#/components/schemas/InlineFile",
            "description": "Алтернатива на X-Napi-File-Path: подайте съдържанието на файла директно в JSON-а (base64) вместо път до файл. XML файл със справката по чл. 73, ал. 1 ЗДДФЛ за посочената година. Файлът се записва под системния temp и се трие автоматично след handler-а."
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year"
        ],
        "type": "object"
      },
      "Dec731ResultRequest": {
        "properties": {
          "documentId": {
            "description": "ID на подадения документ — върнат от submit операцията като documentId.",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "eik"
        ],
        "type": "object"
      },
      "Dec731SubmissionResult": {
        "properties": {
          "documentId": {
            "description": "Идентификатор на документа в НАП (pid / DOCID).",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "errorMessage": {
            "description": "Свободен текст с описание на грешката, ако има такава.",
            "nullable": true,
            "title": "Съобщение за грешка",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Технически грешки върнати от PLS формата на портала; празен масив при успех.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "title": "Native грешки",
            "type": "array"
          },
          "submissionDate": {
            "description": "Времеви маркер на подаването от страна на НАП.",
            "format": "date-time",
            "nullable": true,
            "title": "Дата на подаване",
            "type": "string"
          },
          "success": {
            "description": "true когато НАП прие декларацията.",
            "title": "Успех",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "Dec736Request": {
        "properties": {
          "_inlineFile": {
            "$ref": "#/components/schemas/InlineFile",
            "description": "Алтернатива на X-Napi-File-Path: подайте съдържанието на файла директно в JSON-а (base64) вместо път до файл. XML файл със справката по чл. 73, ал. 6 ЗДДФЛ за посочената година. Файлът се записва под системния temp и се трие автоматично след handler-а."
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year"
        ],
        "type": "object"
      },
      "Dec736ResultRequest": {
        "properties": {
          "documentId": {
            "description": "ID на подадения документ — върнат от submit операцията като documentId.",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "eik"
        ],
        "type": "object"
      },
      "Dec736SubmissionResult": {
        "properties": {
          "documentId": {
            "description": "Идентификатор на документа в НАП (pid / DOCID).",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "errorMessage": {
            "description": "Свободен текст с описание на грешката, ако има такава.",
            "nullable": true,
            "title": "Съобщение за грешка",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Технически грешки върнати от PLS формата на портала; празен масив при успех.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "title": "Native грешки",
            "type": "array"
          },
          "submissionDate": {
            "description": "Времеви маркер на подаването от страна на НАП.",
            "format": "date-time",
            "nullable": true,
            "title": "Дата на подаване",
            "type": "string"
          },
          "success": {
            "description": "true когато НАП прие декларацията.",
            "title": "Успех",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "Dec92DocumentRequest": {
        "properties": {
          "documentId": {
            "description": "ID на документа от dec92_submitted (declarationDocId за dec92_document / dec92_pdf, resultDocId за dec92_result).",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "eik",
          "documentId"
        ],
        "type": "object"
      },
      "Dec92DocumentResult": {
        "properties": {
          "encoding": {
            "description": "utf-8 за HTML; base64 за бинарен PDF.",
            "enum": [
              "utf-8",
              "base64"
            ],
            "title": "Кодиране",
            "type": "string"
          },
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "rawBody": {
            "description": "Съдържанието на документа. При encoding=base64 (PDF) трябва да се декодира; при utf-8 е суров HTML.",
            "title": "Тяло",
            "type": "string"
          },
          "rawBodyContentType": {
            "description": "Content-Type на тялото — text/html или application/pdf.",
            "title": "MIME тип",
            "type": "string"
          },
          "rawBodyUrl": {
            "description": "URL на портала, откъдето е изтеглено.",
            "title": "Изходен URL",
            "type": "string"
          },
          "status": {
            "description": "ok при успех; error при HTTP грешка или липсваща услуга.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "rawBody",
          "rawBodyContentType",
          "encoding",
          "rawBodyUrl",
          "status"
        ],
        "type": "object"
      },
      "Dec92PdfRequest": {
        "properties": {
          "documentId": {
            "description": "ID на документа от dec92_submitted (declarationDocId за dec92_document / dec92_pdf, resultDocId за dec92_result).",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "eik",
          "documentId"
        ],
        "type": "object"
      },
      "Dec92Request": {
        "properties": {
          "_inlineFile": {
            "$ref": "#/components/schemas/InlineFile",
            "description": "Алтернатива на X-Napi-File-Path: подайте съдържанието на файла директно в JSON-а (base64) вместо път до файл. XML файл с ГДД по чл. 92 ЗКПО за посочената година. Файлът се записва под системния temp и се трие автоматично след handler-а."
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year"
        ],
        "type": "object"
      },
      "Dec92ResultRequest": {
        "properties": {
          "documentId": {
            "description": "ID на подадения документ — върнат от submit операцията като documentId.",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "eik"
        ],
        "type": "object"
      },
      "Dec92SubmissionResult": {
        "properties": {
          "documentId": {
            "description": "Идентификатор на документа в НАП (pid / DOCID).",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "errorMessage": {
            "description": "Свободен текст с описание на грешката, ако има такава.",
            "nullable": true,
            "title": "Съобщение за грешка",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Технически грешки върнати от PLS формата на портала; празен масив при успех.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "title": "Native грешки",
            "type": "array"
          },
          "submissionDate": {
            "description": "Времеви маркер на подаването от страна на НАП.",
            "format": "date-time",
            "nullable": true,
            "title": "Дата на подаване",
            "type": "string"
          },
          "success": {
            "description": "true когато НАП прие декларацията.",
            "title": "Успех",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "Dec92SubmittedItem": {
        "properties": {
          "declarationDocId": {
            "description": "pdoc_id — подава се на dec92_document и dec92_pdf.",
            "title": "ID декларация",
            "type": "string"
          },
          "entryDate": {
            "description": "Дата и час на подаване.",
            "title": "Подадено на",
            "type": "string"
          },
          "entryNumber": {
            "description": "Входящ номер на подаването.",
            "title": "Вх. номер",
            "type": "string"
          },
          "resultDocId": {
            "description": "ipdoc_id — подава се на dec92_result.",
            "title": "ID резултат",
            "type": "string"
          },
          "status": {
            "description": "Статус на обработката (свободен текст от портала).",
            "title": "Статус",
            "type": "string"
          },
          "year": {
            "description": "Данъчният период (година) на декларацията.",
            "title": "Дан. период",
            "type": "string"
          }
        },
        "required": [
          "year",
          "entryNumber",
          "entryDate",
          "status",
          "declarationDocId",
          "resultDocId"
        ],
        "type": "object"
      },
      "Dec92SubmittedRequest": {
        "properties": {
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik"
        ],
        "type": "object"
      },
      "Dec92SubmittedResult": {
        "properties": {
          "count": {
            "description": "Брой намерени подадени декларации.",
            "format": "int64",
            "nullable": true,
            "title": "Брой",
            "type": "integer"
          },
          "declarations": {
            "description": "Подадените ГДД по чл. 92 за фирмата (по подразбиране всички години).",
            "items": {
              "$ref": "#/components/schemas/Dec92SubmittedItem"
            },
            "title": "Декларации",
            "type": "array"
          },
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "status": {
            "description": "ok при успех; error при HTTP грешка или липсваща услуга.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "declarations",
          "status"
        ],
        "type": "object"
      },
      "DueAmountItem": {
        "properties": {
          "debtPeriod": {
            "description": "Период за който се отнася задължението (свободен текст).",
            "nullable": true,
            "title": "Период",
            "type": "string"
          },
          "debtTypeName": {
            "description": "Текстово описание на типа задължение.",
            "title": "Вид задължение",
            "type": "string"
          },
          "documentDate": {
            "description": "ISO дата на издаване на документа.",
            "format": "date",
            "nullable": true,
            "title": "Дата на документа",
            "type": "string"
          },
          "documentNumber": {
            "description": "Идентификатор на документа издадeн от НАП.",
            "title": "Документ №",
            "type": "string"
          },
          "documentType": {
            "description": "Тип на документа, по който е възникнало задължението.",
            "title": "Вид документ",
            "type": "string"
          },
          "dueAmount": {
            "description": "Първоначално начислена сума.",
            "format": "double",
            "title": "Дължима сума",
            "type": "number"
          },
          "dueDate": {
            "description": "Падеж на задължението.",
            "format": "date",
            "nullable": true,
            "title": "Падеж",
            "type": "string"
          },
          "outstandingAmount": {
            "description": "Неплатен остатък по главницата (0 / null когато е изцяло платен).",
            "format": "double",
            "nullable": true,
            "title": "Остатък за плащане",
            "type": "number"
          },
          "outstandingInterest": {
            "description": "Начислени лихви върху неплатения остатък (0 / null когато няма лихви).",
            "format": "double",
            "nullable": true,
            "title": "Начислени лихви",
            "type": "number"
          }
        },
        "required": [
          "debtTypeName",
          "documentType",
          "documentNumber",
          "dueAmount"
        ],
        "type": "object"
      },
      "DueAmountsRequest": {
        "properties": {
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik"
        ],
        "type": "object"
      },
      "DueAmountsResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "items": {
            "description": "Един запис на ред — едно задължение към НАП.",
            "items": {
              "$ref": "#/components/schemas/DueAmountItem"
            },
            "title": "Задължения",
            "type": "array"
          },
          "rowCount": {
            "description": "Колко задължения са върнати.",
            "format": "int64",
            "title": "Брой записи",
            "type": "integer"
          },
          "status": {
            "description": "ok при успех; error когато порталът или паресрът е върнал грешка.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "totalInterest": {
            "description": "Сбор на outstandingInterest по всички записи (0 / null когато няма лихви).",
            "format": "double",
            "nullable": true,
            "title": "Общи лихви",
            "type": "number"
          },
          "totalOutstanding": {
            "description": "Сбор на outstandingAmount по всички записи (0 / null когато няма дължими).",
            "format": "double",
            "nullable": true,
            "title": "Общ остатък",
            "type": "number"
          },
          "year": {
            "description": "Годината, за която е поискана справката.",
            "format": "int64",
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "year",
          "rowCount",
          "status"
        ],
        "type": "object"
      },
      "EetzBusinessRecordsRequest": {
        "properties": {
          "activeOnly": {
            "default": "true",
            "description": "true = само действащите записи; false = и прекратените.",
            "title": "Само действащи",
            "type": "boolean"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "withoutSalary": {
            "default": "false",
            "description": "true = справката се връща без колоната с възнаграждение.",
            "title": "Без размер на заплата",
            "type": "boolean"
          }
        },
        "required": [
          "eik"
        ],
        "type": "object"
      },
      "EetzBusinessRecordsResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "pagesFetched": {
            "description": "Колко страници са прочетени.",
            "format": "int64",
            "nullable": true,
            "title": "Изтеглени страници",
            "type": "integer"
          },
          "records": {
            "description": "Един ред — един електронен трудов запис. Кодовете по НКПД, КИД и ЕКАТТЕ идват разчетени като наименования, така че не се налага справка в номенклатура.",
            "items": {
              "$ref": "#/components/schemas/EetzRecordItem"
            },
            "title": "Трудови записи",
            "type": "array"
          },
          "rowCount": {
            "description": "Колко записа са върнати.",
            "format": "int64",
            "nullable": true,
            "title": "Брой записи",
            "type": "integer"
          },
          "status": {
            "description": "ok при успех; error при HTTP грешка или неуспешна подготовка на сесията.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "totalElements": {
            "description": "Колко записа обявява порталът. Различава се от rowCount само когато тегленето е спряло по таван.",
            "format": "int64",
            "nullable": true,
            "title": "Общо в портала",
            "type": "integer"
          },
          "truncated": {
            "description": "true когато тегленето е спряло по таван и rowCount е по-малко от totalElements.",
            "nullable": true,
            "title": "Отрязан резултат",
            "type": "boolean"
          }
        },
        "required": [
          "records",
          "status"
        ],
        "type": "object"
      },
      "EetzRecordItem": {
        "properties": {
          "additionalAgreementDate": {
            "description": "Дата на допълнителното споразумение, променило правоотношението.",
            "format": "date",
            "nullable": true,
            "title": "Дата на промяна",
            "type": "string"
          },
          "beginAdditionalAgreementDate": {
            "description": "От кога действа изменението.",
            "format": "date",
            "nullable": true,
            "title": "Промяната в сила от",
            "type": "string"
          },
          "beginDate": {
            "description": "Начало на изпълнението.",
            "format": "date",
            "nullable": true,
            "title": "Начало",
            "type": "string"
          },
          "civilServantCode": {
            "description": "Код на заеманата длъжност от държавния служител (12 цифри); празно при трудово правоотношение.",
            "nullable": true,
            "title": "Код на длъжността",
            "type": "string"
          },
          "codeHoursDesc": {
            "description": "Дневна / седмична продължителност, като текст.",
            "nullable": true,
            "title": "Вид работно време",
            "type": "string"
          },
          "compensation222": {
            "description": "Дата на изплатеното обезщетение по чл. 222, ал. 2 КТ при прекратяване на трудовия договор.",
            "format": "date",
            "nullable": true,
            "title": "Обезщетение чл. 222/2",
            "type": "string"
          },
          "compensation222106": {
            "description": "Дата на изплатеното обезщетение по чл. 222, ал. 3 КТ, съответно по чл. 106, ал. 3 ЗДСл при служебно правоотношение.",
            "format": "date",
            "nullable": true,
            "title": "Обезщетение чл. 222/3",
            "type": "string"
          },
          "contractChangeNumber": {
            "description": "Номер на акта за изменение на служебното правоотношение.",
            "nullable": true,
            "title": "Номер на изменението",
            "type": "string"
          },
          "contractNumber": {
            "description": "Номер на трудовия договор / акта за назначаване.",
            "nullable": true,
            "title": "Договор №",
            "type": "string"
          },
          "distraintNotices": {
            "description": "Брой запорни съобщения по чл. 512, ал. 5 ГПК.",
            "format": "int64",
            "nullable": true,
            "title": "Запорни съобщения",
            "type": "integer"
          },
          "ekatteName": {
            "description": "Населено място по ЕКАТТЕ, вече разчетено.",
            "nullable": true,
            "title": "Място",
            "type": "string"
          },
          "employTypeDesc": {
            "description": "Трудово / служебно, като текст.",
            "nullable": true,
            "title": "Вид правоотношение",
            "type": "string"
          },
          "employeeName": {
            "description": "Трите имена на лицето.",
            "title": "Име",
            "type": "string"
          },
          "employeePin": {
            "description": "Идентификатор на лицето.",
            "title": "ЕГН / ЛНЧ",
            "type": "string"
          },
          "employeePinType": {
            "description": "Вид на идентификатора — IND_EGN, IND_LNCH и т.н.",
            "title": "Тип идентификатор",
            "type": "string"
          },
          "employeeRankDesc": {
            "description": "Ранг на държавния служител (дипломатически ранг).",
            "nullable": true,
            "title": "Ранг",
            "type": "string"
          },
          "endDate": {
            "description": "Край при срочен договор.",
            "format": "date",
            "nullable": true,
            "title": "Край",
            "type": "string"
          },
          "etzDate": {
            "description": "Дата на сключване на трудовия договор или на възникване на служебното правоотношение.",
            "format": "date",
            "nullable": true,
            "title": "Дата на ЕТЗ",
            "type": "string"
          },
          "etzReasonDesc": {
            "description": "Основание на записа, като текст.",
            "nullable": true,
            "title": "Основание",
            "type": "string"
          },
          "experienceDiploamticPeriod": {
            "description": "Продължителност на времето, признато за служебен стаж или за стаж в дипломатическата служба — 6 цифри ГГММДД. (Името на полето носи печатната грешка на НАП.)",
            "nullable": true,
            "title": "Служебен стаж",
            "type": "string"
          },
          "experienceWorkingPeriod": {
            "description": "Продължителност на времето, признато за трудов стаж — 6 цифри ГГММДД (години, месеци, дни).",
            "nullable": true,
            "title": "Признат трудов стаж",
            "type": "string"
          },
          "kidDesc": {
            "description": "Наименование по КИД, вече разчетено.",
            "nullable": true,
            "title": "Икономическа дейност",
            "type": "string"
          },
          "noExperience": {
            "description": "Продължителност на времето, което НЕ се признава за трудов стаж — 6 цифри ГГММДД.",
            "nullable": true,
            "title": "Непризнат стаж",
            "type": "string"
          },
          "professionName": {
            "description": "Наименование по НКПД, вече разчетено.",
            "nullable": true,
            "title": "Длъжност",
            "type": "string"
          },
          "salaryEuro": {
            "description": "Размер на основното трудово възнаграждение или на индивидуалната основна месечна заплата, в евро — порталът връща само тази валута.",
            "format": "double",
            "nullable": true,
            "title": "Заплата (EUR)",
            "type": "number"
          },
          "termDate": {
            "description": "Дата на прекратяване; празно за действащ запис.",
            "format": "date",
            "nullable": true,
            "title": "Прекратен на",
            "type": "string"
          },
          "termReasonDesc": {
            "description": "Основание за прекратяване, като текст.",
            "nullable": true,
            "title": "Основание за прекратяване",
            "type": "string"
          },
          "usedVacation": {
            "description": "Дни използван платен годишен отпуск, полагащ се за годината на прекратяване на правоотношението.",
            "format": "int64",
            "nullable": true,
            "title": "Ползван отпуск",
            "type": "integer"
          },
          "vacationDays": {
            "description": "Дни уговорен платен годишен отпуск по трудово правоотношение.",
            "format": "int64",
            "nullable": true,
            "title": "Платен отпуск",
            "type": "integer"
          },
          "workingHours": {
            "description": "Продължителност според codeHoursDesc.",
            "format": "int64",
            "nullable": true,
            "title": "Работни часове",
            "type": "integer"
          }
        },
        "required": [
          "employeePin",
          "employeeName",
          "employeePinType"
        ],
        "type": "object"
      },
      "ErrorCode": {
        "description": "Устойчив идентификатор на грешката. Клиентите разчитат на него, не на текста в `error`. Справка, която не е намерила данни, връща 200 и NO_DATA в metadata.errorCode; всичко останало е 502 с код.",
        "enum": [
          "EIK_MISSING",
          "EIK_FORMAT_UNKNOWN",
          "EIK_MISMATCH_WITH_FILE",
          "YEAR_MISSING",
          "YEAR_INVALID",
          "MONTH_INVALID",
          "DOCUMENT_ID_MISSING",
          "DIRECTORY_MISSING",
          "FILE_PATH_MISSING",
          "CONTENT_MISSING",
          "CONTENT_NOT_BASE64",
          "FILE_NAME_INVALID",
          "TARGET_PATH_MISSING",
          "DECLARATION_KIND_UNKNOWN",
          "OPERATION_UNKNOWN",
          "SENDER_UNKNOWN",
          "REQUEST_BODY_INVALID",
          "DEC16_NO_FILE_GIVEN",
          "DEC16_TIN_MISMATCH",
          "DEC16_PERIOD_MISMATCH",
          "CERTIFICATE_NOT_SELECTED",
          "CERTIFICATE_NOT_THIS_SENDER",
          "CERTIFICATE_UNREADABLE",
          "CERTIFICATE_REGISTRATION_STALE",
          "PIN_MISSING",
          "PIN_REJECTED",
          "PIN_ENTRY_CANCELLED",
          "SENDER_NOT_CHOSEN",
          "SIGNER_UNAVAILABLE",
          "SIGNING_FAILED",
          "SIGNATURE_EMPTY",
          "API_KEY_MISSING",
          "OPERATION_TOKEN_MISSING",
          "OPERATION_TOKEN_INVALID",
          "OPERATION_TOKEN_EXPIRED",
          "OPERATION_TOKEN_ISSUER_MISMATCH",
          "OPERATION_TOKEN_OPERATION_MISMATCH",
          "OPERATION_TOKEN_ALREADY_USED",
          "OPERATION_TOKEN_EIK_MISMATCH",
          "OPERATION_TOKEN_KEY_UNAVAILABLE",
          "LOGIN_FAILED",
          "SESSION_EXPIRED",
          "SERVICE_NOT_AVAILABLE",
          "SERVICE_LINK_NOT_FOUND",
          "TAXPAYER_NOT_PERMITTED",
          "TAXPAYER_NOT_SELECTED",
          "TAXPAYER_LIST_EMPTY",
          "PORTAL_HTTP_STATUS",
          "PORTAL_NOT_JSON",
          "PORTAL_FIELD_MISSING",
          "PORTAL_ACCESS_DENIED",
          "PORTAL_RESPONSE_UNRECOGNISED",
          "PORTAL_NO_CONFIRMATION",
          "NRA_REJECTED",
          "FILE_NOT_READABLE",
          "FILE_NOT_WRITABLE",
          "FILE_EMPTY",
          "FOLDER_NOT_FOUND",
          "FILE_VALIDATION_FAILED",
          "NO_DATA",
          "INTERNAL",
          "SUBMISSION_FAILED",
          "JAVA_MISSING",
          "VALIDATOR_INSTALL_FAILED",
          "COMPRESSION_FAILED",
          "DEMO_DATA_MISSING"
        ],
        "type": "string",
        "x-enum-descriptions": [
          "Липсва задължителен параметър ЕИК.",
          "ЕИК не съответства на познат формат — очакват се 9, 10 или 13 цифри.",
          "Подаденият ЕИК не съвпада с ЕИК във файла.",
          "Липсва задължителен параметър година.",
          "Невалидна година.",
          "Невалиден месец — допустими са стойности от 1 до 12.",
          "Липсва задължителен параметър номер на документ.",
          "Липсва задължителен параметър папка.",
          "Не е подаден файл за подаване.",
          "Липсва съдържание за запис.",
          "Съдържанието е празно или не е валиден base64.",
          "Невалидно име на файл.",
          "Подайте път до файл, или папка и име на файл.",
          "Непознат или липсващ вид декларация.",
          "Непозната операция.",
          "Непознат подател.",
          "Тялото на заявката не е валиден JSON.",
          "Подайте поне един от файловете — за Декларация образец 1 или образец 6.",
          "ЕИК/Булстат не съвпада между Декларация образец 1 и образец 6.",
          "Периодът във файла не съвпада с подадените параметри.",
          "За подателя не е избран КЕП сертификат.",
          "Картата в четеца не е тази на избрания подател. Сменете картата или изберете подателя, чийто сертификат е в четеца.",
          "Сертификатът за КЕП не е достъпен. Проверете дали смарт картата е поставена в четеца и драйверите са активни.",
          "Носителят е поставен, но сертификатът в Windows сочи към ключ, който вече не е на него — обикновено след преиздаване на КЕП. Извадете и поставете носителя наново или пререгистрирайте сертификата.",
          "Картата е разпозната, но ключът не се отключва — липсва PIN. Въведете PIN от бутона до сертификата в настройките.",
          "Картата отхвърли PIN кода.",
          "Въвеждането на PIN беше отказано.",
          "Операцията е отказана от клиента — не беше избран подател.",
          "Няма достъп до подписващия компонент.",
          "Подписването не успя.",
          "Подписът е празен — неуспешно подписване.",
          "За подателя не е зададен API ключ.",
          "Заявката дойде без разрешение за операцията.",
          "Разрешението за операцията е невалидно.",
          "Разрешението за операцията е изтекло. Заявете операцията отново.",
          "Разрешението е издадено от друг сървър и агентът не го приема.",
          "Разрешението е издадено за друга операция.",
          "Разрешението вече е използвано. Заявете операцията отново.",
          "Разрешението е издадено за друг ЕИК.",
          "Агентът не достига ключа на napi.bg, за да провери разрешението.",
          "Неуспешен вход в портала на НАП.",
          "Сесията с портала е изгубена — вписването трябва да се повтори.",
          "Услугата не е достъпна за това лице с този сертификат — пълномощното не я включва или лицето няма съответната регистрация в НАП.",
          "Не е намерен адрес за заявената услуга в портала.",
          "Този КЕП няма права за избраното данъчно задължено лице.",
          "Не е избрано данъчно задължено лице за тази сесия.",
          "Няма достъпни данъчно задължени лица за този КЕП.",
          "Порталът на НАП отговори с неочакван HTTP статус.",
          "Отговорът на портала не е валиден JSON.",
          "В отговора на портала липсва очаквано поле.",
          "Порталът отказа достъп до заявения документ.",
          "Порталът върна страница, различна от очакваната.",
          "Декларацията е изпратена, но НАП не върна потвърждение. Проверете в портала на НАП дали е приета.",
          "НАП отхвърли заявката.",
          "Файлът не може да бъде прочетен.",
          "Файлът не може да бъде записан.",
          "Файлът е празен.",
          "Папката не съществува.",
          "Файловата валидация не мина.",
          "Няма данни по заявката.",
          "Възникна непредвидена грешка.",
          "Възникна грешка при подаване на декларацията.",
          "За подаване на ДДС декларация е нужна Java 11 или по-нова. Изтеглете Microsoft OpenJDK 11, инсталирайте я и рестартирайте НАПИ агента.",
          "Не успяхме да инсталираме библиотеките за валидация. Проверете дали сте влезли в НАП.",
          "Компресирането на файла не успя.",
          "Демо данните не са заредени."
        ],
        "x-enum-kinds": [
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "PARAMETER",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "CREDENTIALS",
          "SESSION",
          "SESSION",
          "SESSION",
          "SESSION",
          "TAXPAYER",
          "TAXPAYER",
          "TAXPAYER",
          "PORTAL",
          "PORTAL",
          "PORTAL",
          "PORTAL",
          "PORTAL",
          "PORTAL",
          "PORTAL",
          "FILE",
          "FILE",
          "FILE",
          "FILE",
          "FILE",
          "DATA",
          "INTERNAL",
          "INTERNAL",
          "INTERNAL",
          "INTERNAL",
          "INTERNAL",
          "INTERNAL"
        ]
      },
      "ErrorKind": {
        "description": "Общият вид на грешката. Ползвайте го, когато точният код няма значение — например всяка PARAMETER грешка се поправя от извикващия, всяка CREDENTIALS иска действие от потребителя.",
        "enum": [
          "PARAMETER",
          "CREDENTIALS",
          "SESSION",
          "TAXPAYER",
          "PORTAL",
          "FILE",
          "DATA",
          "INTERNAL"
        ],
        "type": "string"
      },
      "Etz123BatchItem": {
        "properties": {
          "documentId": {
            "description": "Идентификатор за справката за резултат; празно при failed / skipped.",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК, прочетен от XML-а; празно когато файлът не носи `eik`.",
            "nullable": true,
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "file": {
            "description": "Пълен път до XML файла (UTF-8).",
            "title": "Файл",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП; празно при failed / skipped.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "message": {
            "description": "Причина за отказа или за пропускането.",
            "nullable": true,
            "title": "Съобщение",
            "type": "string"
          },
          "status": {
            "description": "submitted — прието от НАП; failed — опитано и отказано; skipped — изобщо не е подавано (ЕИК извън токена или извън филтъра).",
            "enum": [
              "submitted",
              "failed",
              "skipped"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "file",
          "status"
        ],
        "type": "object"
      },
      "Etz123BatchRequest": {
        "properties": {
          "eik": {
            "description": "Само за тази фирма; празно = всички от токена.",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "recursive": {
            "default": "true",
            "description": "Сканира и подпапките. По подразбиране true.",
            "title": "Рекурсивно",
            "type": "boolean"
          },
          "rootFolder": {
            "description": "Папка с XML файловете на уведомленията.",
            "title": "Папка",
            "type": "string"
          }
        },
        "required": [
          "rootFolder"
        ],
        "type": "object"
      },
      "Etz123BatchResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "failed": {
            "description": "Брой отказани подавания.",
            "format": "int64",
            "title": "Неуспешни",
            "type": "integer"
          },
          "items": {
            "description": "По един ред на намерен файл — подаден, отказан или пропуснат (виж `status` на реда).",
            "items": {
              "$ref": "#/components/schemas/Etz123BatchItem"
            },
            "title": "Уведомления",
            "type": "array"
          },
          "skipped": {
            "description": "Брой файлове, които не са подавани.",
            "format": "int64",
            "title": "Пропуснати",
            "type": "integer"
          },
          "status": {
            "description": "ok когато всичко намерено е прието; partial при поне едно отказано или пропуснато; error когато нищо не е подадено (виж `error`).",
            "enum": [
              "ok",
              "partial",
              "error"
            ],
            "title": "Общ статус",
            "type": "string"
          },
          "submitted": {
            "description": "Брой успешно приети подавания.",
            "format": "int64",
            "title": "Подадени",
            "type": "integer"
          },
          "totalMatched": {
            "description": "Брой файлове, разпознати като уведомления по този член.",
            "format": "int64",
            "title": "Съответстващи",
            "type": "integer"
          },
          "totalScanned": {
            "description": "Брой .XML файлове проверени.",
            "format": "int64",
            "title": "Общо сканирани",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "totalScanned",
          "totalMatched",
          "submitted",
          "failed",
          "skipped",
          "status"
        ],
        "type": "object"
      },
      "Etz123PortalFileItem": {
        "properties": {
          "content": {
            "description": "Съдържание на подписания файл като текст.",
            "title": "Съдържание",
            "type": "string"
          },
          "documentId": {
            "description": "ID на документа в портала.",
            "title": "Document ID",
            "type": "string"
          },
          "documentType": {
            "description": "Наименованието, с което НАП описва документа.",
            "nullable": true,
            "title": "Вид документ",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер на подаването.",
            "title": "Вх. номер",
            "type": "string"
          },
          "name": {
            "description": "Име на файла, съставено от входящия номер.",
            "title": "Име",
            "type": "string"
          },
          "resultStatus": {
            "description": "Статус на обработката в НАП — напр. PROCESSED.",
            "nullable": true,
            "title": "Статус",
            "type": "string"
          },
          "submittedAt": {
            "description": "Дата и час на подаване (ISO-8601).",
            "title": "Подадено на",
            "type": "string"
          }
        },
        "required": [
          "name",
          "documentId",
          "content",
          "incomeNumber",
          "submittedAt"
        ],
        "type": "object"
      },
      "Etz123PortalFilesRequest": {
        "properties": {
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "month": {
            "description": "Месец на подаване (1-12); празно = цялата година.",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year"
        ],
        "type": "object"
      },
      "Etz123PortalFilesResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "fileCount": {
            "description": "Брой успешно изтеглени файлове.",
            "format": "int64",
            "nullable": true,
            "title": "Брой файлове",
            "type": "integer"
          },
          "files": {
            "description": "По един ред на изтеглен файл — едно подадено уведомление носи един подписан XML.",
            "items": {
              "$ref": "#/components/schemas/Etz123PortalFileItem"
            },
            "title": "Файлове",
            "type": "array"
          },
          "status": {
            "description": "ok при успех; error при липсващи подавания или HTTP грешка от портала.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "submissionCount": {
            "description": "Брой подавания, намерени за периода.",
            "format": "int64",
            "nullable": true,
            "title": "Брой подавания",
            "type": "integer"
          }
        },
        "required": [
          "files",
          "status"
        ],
        "type": "object"
      },
      "Etz123Request": {
        "properties": {
          "_inlineFile": {
            "$ref": "#/components/schemas/InlineFile",
            "description": "Алтернатива на X-Napi-File-Path: подайте съдържанието на файла директно в JSON-а (base64) вместо път до файл. XML файл с уведомление по чл. 123, ал. 1 КТ (по схемата на НАП). Файлът се записва под системния temp и се трие автоматично след handler-а."
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "eik"
        ],
        "type": "object"
      },
      "Etz123ResultRequest": {
        "properties": {
          "documentId": {
            "description": "ID на подадения документ — върнат от submit операцията като documentId.",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "eik"
        ],
        "type": "object"
      },
      "Etz123SubmissionResult": {
        "properties": {
          "documentId": {
            "description": "Идентификатор на документа в НАП (pid / DOCID).",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "errorMessage": {
            "description": "Свободен текст с описание на грешката, ако има такава.",
            "nullable": true,
            "title": "Съобщение за грешка",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Технически грешки върнати от REST API на НАП; празен масив при успех.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "title": "Native грешки",
            "type": "array"
          },
          "submissionDate": {
            "description": "Времеви маркер на подаването от страна на НАП.",
            "format": "date-time",
            "nullable": true,
            "title": "Дата на подаване",
            "type": "string"
          },
          "success": {
            "description": "true когато НАП прие декларацията.",
            "title": "Успех",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "Etz62BatchItem": {
        "properties": {
          "documentId": {
            "description": "Идентификатор за справката за резултат; празно при failed / skipped.",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК, прочетен от XML-а; празно когато файлът не носи `eik`.",
            "nullable": true,
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "file": {
            "description": "Пълен път до XML файла (UTF-8).",
            "title": "Файл",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП; празно при failed / skipped.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "message": {
            "description": "Причина за отказа или за пропускането.",
            "nullable": true,
            "title": "Съобщение",
            "type": "string"
          },
          "status": {
            "description": "submitted — прието от НАП; failed — опитано и отказано; skipped — изобщо не е подавано (ЕИК извън токена или извън филтъра).",
            "enum": [
              "submitted",
              "failed",
              "skipped"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "file",
          "status"
        ],
        "type": "object"
      },
      "Etz62BatchRequest": {
        "properties": {
          "eik": {
            "description": "Само за тази фирма; празно = всички от токена.",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "recursive": {
            "default": "true",
            "description": "Сканира и подпапките. По подразбиране true.",
            "title": "Рекурсивно",
            "type": "boolean"
          },
          "rootFolder": {
            "description": "Папка с XML файловете на уведомленията.",
            "title": "Папка",
            "type": "string"
          }
        },
        "required": [
          "rootFolder"
        ],
        "type": "object"
      },
      "Etz62BatchResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "failed": {
            "description": "Брой отказани подавания.",
            "format": "int64",
            "title": "Неуспешни",
            "type": "integer"
          },
          "items": {
            "description": "По един ред на намерен файл — подаден, отказан или пропуснат (виж `status` на реда).",
            "items": {
              "$ref": "#/components/schemas/Etz62BatchItem"
            },
            "title": "Уведомления",
            "type": "array"
          },
          "skipped": {
            "description": "Брой файлове, които не са подавани.",
            "format": "int64",
            "title": "Пропуснати",
            "type": "integer"
          },
          "status": {
            "description": "ok когато всичко намерено е прието; partial при поне едно отказано или пропуснато; error когато нищо не е подадено (виж `error`).",
            "enum": [
              "ok",
              "partial",
              "error"
            ],
            "title": "Общ статус",
            "type": "string"
          },
          "submitted": {
            "description": "Брой успешно приети подавания.",
            "format": "int64",
            "title": "Подадени",
            "type": "integer"
          },
          "totalMatched": {
            "description": "Брой файлове, разпознати като уведомления по този член.",
            "format": "int64",
            "title": "Съответстващи",
            "type": "integer"
          },
          "totalScanned": {
            "description": "Брой .XML файлове проверени.",
            "format": "int64",
            "title": "Общо сканирани",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "totalScanned",
          "totalMatched",
          "submitted",
          "failed",
          "skipped",
          "status"
        ],
        "type": "object"
      },
      "Etz62PortalFileItem": {
        "properties": {
          "content": {
            "description": "Съдържание на подписания файл като текст.",
            "title": "Съдържание",
            "type": "string"
          },
          "documentId": {
            "description": "ID на документа в портала.",
            "title": "Document ID",
            "type": "string"
          },
          "documentType": {
            "description": "Наименованието, с което НАП описва документа.",
            "nullable": true,
            "title": "Вид документ",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер на подаването.",
            "title": "Вх. номер",
            "type": "string"
          },
          "name": {
            "description": "Име на файла, съставено от входящия номер.",
            "title": "Име",
            "type": "string"
          },
          "resultStatus": {
            "description": "Статус на обработката в НАП — напр. PROCESSED.",
            "nullable": true,
            "title": "Статус",
            "type": "string"
          },
          "submittedAt": {
            "description": "Дата и час на подаване (ISO-8601).",
            "title": "Подадено на",
            "type": "string"
          }
        },
        "required": [
          "name",
          "documentId",
          "content",
          "incomeNumber",
          "submittedAt"
        ],
        "type": "object"
      },
      "Etz62PortalFilesRequest": {
        "properties": {
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "month": {
            "description": "Месец на подаване (1-12); празно = цялата година.",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year"
        ],
        "type": "object"
      },
      "Etz62PortalFilesResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "fileCount": {
            "description": "Брой успешно изтеглени файлове.",
            "format": "int64",
            "nullable": true,
            "title": "Брой файлове",
            "type": "integer"
          },
          "files": {
            "description": "По един ред на изтеглен файл — едно подадено уведомление носи един подписан XML.",
            "items": {
              "$ref": "#/components/schemas/Etz62PortalFileItem"
            },
            "title": "Файлове",
            "type": "array"
          },
          "status": {
            "description": "ok при успех; error при липсващи подавания или HTTP грешка от портала.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "submissionCount": {
            "description": "Брой подавания, намерени за периода.",
            "format": "int64",
            "nullable": true,
            "title": "Брой подавания",
            "type": "integer"
          }
        },
        "required": [
          "files",
          "status"
        ],
        "type": "object"
      },
      "Etz62Request": {
        "properties": {
          "_inlineFile": {
            "$ref": "#/components/schemas/InlineFile",
            "description": "Алтернатива на X-Napi-File-Path: подайте съдържанието на файла директно в JSON-а (base64) вместо път до файл. XML файл с уведомление по чл. 62, ал. 5 КТ (по схемата на НАП). Файлът се записва под системния temp и се трие автоматично след handler-а."
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "eik"
        ],
        "type": "object"
      },
      "Etz62ResultRequest": {
        "properties": {
          "documentId": {
            "description": "ID на подадения документ — върнат от submit операцията като documentId.",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "eik"
        ],
        "type": "object"
      },
      "Etz62SubmissionResult": {
        "properties": {
          "documentId": {
            "description": "Идентификатор на документа в НАП (pid / DOCID).",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "errorMessage": {
            "description": "Свободен текст с описание на грешката, ако има такава.",
            "nullable": true,
            "title": "Съобщение за грешка",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Технически грешки върнати от REST API на НАП; празен масив при успех.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "title": "Native грешки",
            "type": "array"
          },
          "submissionDate": {
            "description": "Времеви маркер на подаването от страна на НАП.",
            "format": "date-time",
            "nullable": true,
            "title": "Дата на подаване",
            "type": "string"
          },
          "success": {
            "description": "true когато НАП прие декларацията.",
            "title": "Успех",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "HighFiscRiskRequest": {
        "properties": {
          "_inlineFile": {
            "$ref": "#/components/schemas/InlineFile",
            "description": "Алтернатива на X-Napi-File-Path: подайте съдържанието на файла директно в JSON-а (base64) вместо път до файл. XML файл за превоза, съответстващ на избрания `subtype`. Файлът се записва под системния temp и се трие автоматично след handler-а."
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "subtype": {
            "description": "Вид на превоза: EU_BG = внос от ЕС в БГ; BG_EU = износ от БГ в ЕС; BG_BG = вътрешен транспорт; IMPORT = от трета страна; ANNUL = анулиране на подадена декларация; CONFIRM = потвърждение на получаването.",
            "enum": [
              "EU_BG",
              "BG_EU",
              "BG_BG",
              "IMPORT",
              "ANNUL",
              "CONFIRM"
            ],
            "title": "Подтип",
            "type": "string"
          }
        },
        "required": [
          "eik",
          "subtype"
        ],
        "type": "object"
      },
      "HighFiscRiskResultRequest": {
        "properties": {
          "documentId": {
            "description": "ID на подадения документ — върнат от submit операцията като documentId.",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "eik"
        ],
        "type": "object"
      },
      "HighFiscRiskShowRequest": {
        "properties": {
          "documentId": {
            "description": "ID на подадения документ — върнат от submit операцията като documentId.",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "eik"
        ],
        "type": "object"
      },
      "HighFiscRiskShowResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "rawBody": {
            "description": "Цялото HTML тяло на портал-страницата за документа.",
            "title": "HTML съдържание",
            "type": "string"
          },
          "rawBodyContentType": {
            "description": "Content-Type на rawBody — text/html, charset според портала.",
            "title": "MIME тип",
            "type": "string"
          },
          "rawBodyUrl": {
            "description": "Пълен URL на показаната страница (за повторна заявка / линк).",
            "title": "URL на портала",
            "type": "string"
          },
          "status": {
            "description": "ok при успех; error когато порталът върне non-2xx или сесията не успее.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "rawBody",
          "rawBodyContentType",
          "rawBodyUrl",
          "status"
        ],
        "type": "object"
      },
      "HighFiscRiskSubmissionResult": {
        "properties": {
          "documentId": {
            "description": "Идентификатор на документа в НАП (pid / DOCID).",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "errorMessage": {
            "description": "Свободен текст с описание на грешката, ако има такава.",
            "nullable": true,
            "title": "Съобщение за грешка",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Технически грешки върнати от REST API на НАП; празен масив при успех.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "title": "Native грешки",
            "type": "array"
          },
          "submissionDate": {
            "description": "Времеви маркер на подаването от страна на НАП.",
            "format": "date-time",
            "nullable": true,
            "title": "Дата на подаване",
            "type": "string"
          },
          "success": {
            "description": "true когато НАП прие декларацията.",
            "title": "Успех",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "InlineDir": {
        "description": "Няколко файла, подадени в тялото на заявката и записани в обща временна папка, която се подава на операцията вместо път до папка. Кои файлове очаква конкретната операция е описано в нейния `_inlineDir`.",
        "properties": {
          "files": {
            "description": "Списък от файлове за писане в temp папката.",
            "items": {
              "$ref": "#/components/schemas/InlineDirEntry"
            },
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "files"
        ],
        "type": "object"
      },
      "InlineDirEntry": {
        "properties": {
          "contentBase64": {
            "description": "Съдържание на файла, base64-кодирано. Празен низ = празен файл (0 байта); неподадените файлове просто липсват в папката.",
            "format": "byte",
            "type": "string"
          },
          "filename": {
            "type": "string"
          }
        },
        "required": [
          "filename",
          "contentBase64"
        ],
        "type": "object"
      },
      "InlineFile": {
        "description": "Единичен файл, подаден директно в тялото на заявката. Кой файл очаква конкретната операция е описано в нейния `_inlineFile`.",
        "properties": {
          "contentBase64": {
            "description": "Съдържание на файла, base64-кодирано.",
            "format": "byte",
            "type": "string"
          },
          "filename": {
            "description": "Име на файла (за temp пътя). Path separators / wildcard chars се премахват.",
            "type": "string"
          }
        },
        "required": [
          "filename",
          "contentBase64"
        ],
        "type": "object"
      },
      "NapCatalogEntry": {
        "properties": {
          "category": {
            "description": "Име на родителската категория.",
            "title": "Категория",
            "type": "string"
          },
          "linkType": {
            "description": "NATIVE / LEGACY според това дали е PLS или REST.",
            "nullable": true,
            "title": "Тип link",
            "type": "string"
          },
          "name": {
            "description": "Заглавие на справката (Bulgarian).",
            "title": "Справка",
            "type": "string"
          },
          "serviceId": {
            "description": "Идентификатор на услугата (за директен deep-link).",
            "nullable": true,
            "title": "serviceId",
            "type": "string"
          },
          "systemId": {
            "description": "Идентификатор на системата (PLS / REST).",
            "nullable": true,
            "title": "systemId",
            "type": "string"
          },
          "url": {
            "description": "Пълен absolute URL към справката в портала.",
            "nullable": true,
            "title": "Кликваем URL",
            "type": "string"
          }
        },
        "required": [
          "name",
          "category"
        ],
        "type": "object"
      },
      "NapCatalogRequest": {
        "properties": {
          "filter": {
            "description": "Подниз в име/заглавие/URL; празно = всички",
            "title": "Филтър",
            "type": "string"
          }
        },
        "type": "object"
      },
      "NapCatalogResult": {
        "properties": {
          "categories": {
            "description": "Колко категории е върнал порталът.",
            "format": "int64",
            "title": "Брой категории",
            "type": "integer"
          },
          "error": {
            "description": "Само при status=error.",
            "nullable": true,
            "title": "Текст на грешката",
            "type": "string"
          },
          "items": {
            "description": "Един ред = един service-link от категория на портала.",
            "items": {
              "$ref": "#/components/schemas/NapCatalogEntry"
            },
            "title": "Линкове",
            "type": "array"
          },
          "matchedLinks": {
            "description": "Колко записа отговарят на filter параметъра.",
            "format": "int64",
            "title": "Брой след филтър",
            "type": "integer"
          },
          "status": {
            "description": "ok при успех; error при невъзможност за зареждане.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "totalLinks": {
            "description": "Колко линка има в портала преди филтрирането.",
            "format": "int64",
            "title": "Брой записи общо",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "status",
          "totalLinks",
          "matchedLinks",
          "categories"
        ],
        "type": "object"
      },
      "OditRequest": {
        "properties": {
          "_inlineFile": {
            "$ref": "#/components/schemas/InlineFile",
            "description": "Алтернатива на X-Napi-File-Path: подайте съдържанието на файла директно в JSON-а (base64) вместо път до файл. XML файл със стандартизирания одиторски запис за посочените месец и година. Файлът се записва под системния temp и се трие автоматично след handler-а."
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "month": {
            "description": "Месец от периода (1-12).",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year",
          "month"
        ],
        "type": "object"
      },
      "OditResultPayload": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "processingMessage": {
            "description": "Човекочетим текст на български; при отхвърляне включва и причините.",
            "title": "Съобщение за клиента",
            "type": "string"
          },
          "processingStatus": {
            "description": "processing — приет, но НАП още не е приключил обработката; accepted — приет; rejected — отхвърлен (причините са в processingMessage).",
            "enum": [
              "processing",
              "accepted",
              "rejected"
            ],
            "title": "Статус на обработката",
            "type": "string"
          },
          "rawBody": {
            "description": "HTML на showResult при обработен файл; JSON ред от листинга докато се обработва.",
            "title": "Тяло на отговора",
            "type": "string"
          },
          "rawBodyContentType": {
            "description": "text/html при обработен файл, application/json докато се обработва.",
            "title": "MIME тип",
            "type": "string"
          },
          "rawBodyUrl": {
            "description": "URL на портала, откъдето е взето rawBody.",
            "title": "Изходен URL",
            "type": "string"
          },
          "status": {
            "description": "ok при успех; error при портална/мрежова грешка.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "processingStatus",
          "processingMessage",
          "rawBody",
          "rawBodyContentType",
          "rawBodyUrl",
          "status"
        ],
        "type": "object"
      },
      "OditResultRequest": {
        "properties": {
          "documentId": {
            "description": "ID на подадения документ — върнат от submit операцията като documentId.",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "eik"
        ],
        "type": "object"
      },
      "OditSubmissionResult": {
        "properties": {
          "documentId": {
            "description": "Идентификатор на документа в НАП (pid / DOCID).",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "errorMessage": {
            "description": "Свободен текст с описание на грешката, ако има такава.",
            "nullable": true,
            "title": "Съобщение за грешка",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Технически грешки върнати от PLS формата на портала; празен масив при успех.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "title": "Native грешки",
            "type": "array"
          },
          "submissionDate": {
            "description": "Времеви маркер на подаването от страна на НАП.",
            "format": "date-time",
            "nullable": true,
            "title": "Дата на подаване",
            "type": "string"
          },
          "success": {
            "description": "true когато НАП прие декларацията.",
            "title": "Успех",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "SaveFileRequest": {
        "properties": {
          "contentBase64": {
            "description": "Байтове на файла, base64. Записват се дословно.",
            "title": "Съдържание (base64)",
            "type": "string"
          },
          "dir": {
            "description": "Папка (ползва се с name, когато path е празен).",
            "title": "Папка",
            "type": "string"
          },
          "name": {
            "description": "Име на файла (ползва се с dir).",
            "title": "Име на файл",
            "type": "string"
          },
          "path": {
            "description": "Пълен път на файла. Алтернатива: dir + name.",
            "title": "Път",
            "type": "string"
          }
        },
        "required": [
          "contentBase64"
        ],
        "type": "object"
      },
      "SaveFileResult": {
        "properties": {
          "bytesWritten": {
            "description": "Брой записани байтове.",
            "format": "int64",
            "title": "Байтове",
            "type": "integer"
          },
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "path": {
            "description": "Пълен път на записания файл (UTF-8).",
            "nullable": true,
            "title": "Път",
            "type": "string"
          },
          "status": {
            "description": "ok при успех; error при проблем.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "status",
          "bytesWritten"
        ],
        "type": "object"
      },
      "Sender": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "displayName": {
            "description": "Името, което потребителят е дал на подателя.",
            "type": "string"
          },
          "id": {
            "description": "Стойността за X-Napi-Sender-Id.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "displayName"
        ],
        "type": "object"
      },
      "SenderList": {
        "properties": {
          "activeSenderId": {
            "description": "Подателят, който агентът ползва, когато операцията не подаде X-Napi-Sender-Id.",
            "type": "string"
          },
          "senders": {
            "items": {
              "$ref": "#/components/schemas/Sender"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SubmissionResultPayload": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "rawBody": {
            "description": "HTML / JSON / TXT върнат от НАП за това подаване — от portal.nra.bg при PLS декларациите, от status endpoint-а на REST API при останалите.",
            "title": "Тяло на отговора",
            "type": "string"
          },
          "rawBodyContentType": {
            "description": "Content-Type на rawBody — text/html, application/json, …",
            "title": "MIME тип",
            "type": "string"
          },
          "rawBodyUrl": {
            "description": "URL, от който е получено rawBody (за повторна заявка).",
            "title": "Изходен URL",
            "type": "string"
          },
          "status": {
            "description": "ok при успех; error когато НАП върне non-2xx или документът липсва.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "rawBody",
          "rawBodyContentType",
          "rawBodyUrl",
          "status"
        ],
        "type": "object"
      },
      "TaxpayerItem": {
        "properties": {
          "active": {
            "description": "да / не — стринг за съвместимост със стария вид.",
            "title": "Активен",
            "type": "string"
          },
          "authorization": {
            "description": "Текст на пълномощното, ако е приложимо.",
            "nullable": true,
            "title": "Пълномощно",
            "type": "string"
          },
          "email": {
            "description": "Кореспондентски email регистриран в НАП.",
            "nullable": true,
            "title": "Email",
            "type": "string"
          },
          "name": {
            "description": "Наименование на ЗЛ, както е записано в НАП.",
            "title": "Наименование",
            "type": "string"
          },
          "pin": {
            "description": "Идентификатор на ЗЛ.",
            "title": "ЕИК / Булстат / ЕГН",
            "type": "string"
          },
          "pinType": {
            "description": "BUS_BULSTAT / IND_EGN / IND_BULSTAT / IND_LNCH / IND_SLNO.",
            "title": "Тип идентификатор",
            "type": "string"
          },
          "tin": {
            "description": "Числов идентификатор в портала на НАП.",
            "format": "int64",
            "title": "Портал ID",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "pin",
          "pinType",
          "tin",
          "active"
        ],
        "type": "object"
      },
      "TaxpayersRequest": {
        "properties": {},
        "type": "object"
      },
      "TaxpayersResult": {
        "properties": {
          "count": {
            "description": "Брой върнати задължени лица.",
            "format": "int64",
            "title": "Брой ЗЛ",
            "type": "integer"
          },
          "error": {
            "description": "При status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "items": {
            "description": "Списък на ЗЛ-та, до които има пълномощно по влезлия сертификат.",
            "items": {
              "$ref": "#/components/schemas/TaxpayerItem"
            },
            "title": "Задължени лица",
            "type": "array"
          },
          "status": {
            "description": "ok при успех; error при проблем — текстът е в `error`.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "items",
          "status",
          "count"
        ],
        "type": "object"
      },
      "VatBatchItem": {
        "properties": {
          "documentId": {
            "description": "Идентификатор за vat_result; празно при failed / skipped.",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК, прочетен от DEKLAR.TXT.",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "folder": {
            "description": "Папката на декларацията (пълен път, UTF-8).",
            "title": "Папка",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП; празно при failed / skipped.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "message": {
            "description": "Причина за отказа или за пропускането.",
            "nullable": true,
            "title": "Съобщение",
            "type": "string"
          },
          "month": {
            "description": "Месец на периода (1-12).",
            "format": "int64",
            "title": "Месец",
            "type": "integer"
          },
          "status": {
            "description": "submitted — прието от НАП; failed — опитано и отказано; skipped — изобщо не е подавано (ЕИК извън токена или извън филтъра).",
            "enum": [
              "submitted",
              "failed",
              "skipped"
            ],
            "title": "Статус",
            "type": "string"
          },
          "year": {
            "description": "Година на периода.",
            "format": "int64",
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year",
          "month",
          "folder",
          "status"
        ],
        "type": "object"
      },
      "VatBatchRequest": {
        "properties": {
          "eik": {
            "description": "Само за тази фирма; празно = всички от токена.",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "iban": {
            "description": "Прилага се към ВСЯКА декларация в обхода; празно = без искане.",
            "title": "IBAN за възст.",
            "type": "string"
          },
          "month": {
            "default": "0",
            "description": "1-12; пропусни или 0 за цялата година.",
            "format": "int64",
            "title": "Месец",
            "type": "integer"
          },
          "recursive": {
            "default": "true",
            "description": "Сканира и подпапките. По подразбиране true.",
            "title": "Рекурсивно",
            "type": "boolean"
          },
          "rootFolder": {
            "description": "Папка, чиито подпапки са ДДС декларации.",
            "title": "Папка",
            "type": "string"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "rootFolder",
          "year"
        ],
        "type": "object"
      },
      "VatBatchResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "failed": {
            "description": "Брой отказани подавания.",
            "format": "int64",
            "title": "Неуспешни",
            "type": "integer"
          },
          "items": {
            "description": "По един ред на намерена декларация — подадена, отказана или пропусната (виж `status` на реда).",
            "items": {
              "$ref": "#/components/schemas/VatBatchItem"
            },
            "title": "Декларации",
            "type": "array"
          },
          "skipped": {
            "description": "Брой декларации, които не са подавани.",
            "format": "int64",
            "title": "Пропуснати",
            "type": "integer"
          },
          "status": {
            "description": "ok когато всичко намерено е прието; partial при поне едно отказано или пропуснато; error когато нищо не е подадено (виж `error`).",
            "enum": [
              "ok",
              "partial",
              "error"
            ],
            "title": "Общ статус",
            "type": "string"
          },
          "submitted": {
            "description": "Брой успешно приети подавания.",
            "format": "int64",
            "title": "Подадени",
            "type": "integer"
          },
          "totalMatched": {
            "description": "Брой декларации за зададения филтър.",
            "format": "int64",
            "title": "Съответстващи",
            "type": "integer"
          },
          "totalScanned": {
            "description": "Брой папки с DEKLAR.TXT проверени.",
            "format": "int64",
            "title": "Общо сканирани",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "totalScanned",
          "totalMatched",
          "submitted",
          "failed",
          "skipped",
          "status"
        ],
        "type": "object"
      },
      "VatFileItem": {
        "properties": {
          "content": {
            "description": "UTF-8 съдържание.",
            "title": "Съдържание",
            "type": "string"
          },
          "folder": {
            "description": "Родителската папка.",
            "title": "Папка",
            "type": "string"
          },
          "name": {
            "description": "Име на файла.",
            "title": "Име",
            "type": "string"
          },
          "path": {
            "description": "Пълен път (UTF-8).",
            "title": "Път",
            "type": "string"
          },
          "tin": {
            "description": "БУЛСТАТ от DEKLAR.TXT.",
            "title": "БУЛСТАТ",
            "type": "string"
          }
        },
        "required": [
          "name",
          "path",
          "tin",
          "folder",
          "content"
        ],
        "type": "object"
      },
      "VatFileSummary": {
        "properties": {
          "count": {
            "description": "Брой записи; тире (—) при липсващ файл.",
            "nullable": true,
            "title": "Записи",
            "type": "string"
          },
          "file": {
            "description": "DEKLAR.TXT / POKUPKI.TXT / PRODAGBI.TXT.",
            "title": "Файл",
            "type": "string"
          },
          "status": {
            "description": "ok когато файлът е намерен и парснат; липсва когато не е намерен.",
            "enum": [
              "ok",
              "липсва"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "file",
          "status"
        ],
        "type": "object"
      },
      "VatFilesParseRequest": {
        "properties": {
          "directory": {
            "description": "Папка, в която се намират DEKLAR.TXT / POKUPKI.TXT / PRODAGBI.TXT",
            "title": "Папка с ДДС файлове",
            "type": "string"
          }
        },
        "required": [
          "directory"
        ],
        "type": "object"
      },
      "VatFilesParseResult": {
        "properties": {
          "directory": {
            "description": "Папката, която е била обработена.",
            "title": "Папка",
            "type": "string"
          },
          "error": {
            "description": "Списък на грешки от парсера, разделени с ' ; '.",
            "nullable": true,
            "title": "Грешки",
            "type": "string"
          },
          "items": {
            "description": "Един ред на всеки от трите ДДС файла в избраната папка.",
            "items": {
              "$ref": "#/components/schemas/VatFileSummary"
            },
            "title": "Открити файлове",
            "type": "array"
          },
          "status": {
            "description": "ok когато и трите файла са намерени и парснати; partial когато част липсват или не се парсват; error когато папката не може да бъде прочетена. Подробностите са в `error`.",
            "enum": [
              "ok",
              "partial",
              "error"
            ],
            "title": "Общ статус",
            "type": "string"
          }
        },
        "required": [
          "items",
          "status",
          "directory"
        ],
        "type": "object"
      },
      "VatFilesScanRequest": {
        "properties": {
          "month": {
            "default": "0",
            "description": "1-12; пропусни или 0 за цялата година.",
            "format": "int64",
            "title": "Месец",
            "type": "integer"
          },
          "recursive": {
            "default": "true",
            "description": "Сканира и подпапките. По подразбиране true.",
            "title": "Рекурсивно",
            "type": "boolean"
          },
          "rootFolder": {
            "description": "Папка за рекурсивно сканиране.",
            "title": "Папка",
            "type": "string"
          },
          "year": {
            "description": "Година за филтриране на файловете.",
            "format": "int64",
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "rootFolder",
          "year"
        ],
        "type": "object"
      },
      "VatFilesScanResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "files": {
            "description": "Открити ДДС файлове (DEKLAR/POKUPKI/PRODAGBI) за периода.",
            "items": {
              "$ref": "#/components/schemas/VatFileItem"
            },
            "title": "Файлове",
            "type": "array"
          },
          "status": {
            "description": "ok при успех; error при проблем.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "totalMatched": {
            "description": "Брой бъндли в зададения период.",
            "format": "int64",
            "title": "Съответстващи",
            "type": "integer"
          },
          "totalScanned": {
            "description": "Брой DEKLAR.TXT прегледани.",
            "format": "int64",
            "title": "Общо сканирани",
            "type": "integer"
          }
        },
        "required": [
          "files",
          "totalScanned",
          "totalMatched",
          "status"
        ],
        "type": "object"
      },
      "VatMonthlyFilesRequest": {
        "properties": {
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "month": {
            "description": "Месец от периода (1-12).",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "onlyDeclaration": {
            "default": "false",
            "description": "Когато е true, парсва само DEKLAR и пропуска POKUPKI / PRODAGBI / VIES.",
            "title": "Само DEKLAR",
            "type": "boolean"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year"
        ],
        "type": "object"
      },
      "VatMonthlyFilesResult": {
        "properties": {
          "error": {
            "description": "При status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "items": {
            "description": "Едно подаване на ред — метаданни + парснатите файлове.",
            "items": {
              "$ref": "#/components/schemas/VatMonthlySubmission"
            },
            "title": "Подавания за месеца",
            "type": "array"
          },
          "status": {
            "description": "ok при успех; error при проблем — текстът е в `error`.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "items",
          "status"
        ],
        "type": "object"
      },
      "VatMonthlySubmission": {
        "properties": {
          "declaration": {
            "description": "Парснат JSON на декларацията — низ за съвместимост.",
            "nullable": true,
            "title": "DEKLAR.TXT (JSON)",
            "type": "string"
          },
          "docId": {
            "description": "Идентификатор на документа в портала.",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер от portal.nra.bg.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "purchases": {
            "description": "Парснат JSON на покупките.",
            "nullable": true,
            "title": "POKUPKI.TXT (JSON)",
            "type": "string"
          },
          "sales": {
            "description": "Парснат JSON на продажбите.",
            "nullable": true,
            "title": "PRODAGBI.TXT (JSON)",
            "type": "string"
          },
          "submittedAt": {
            "description": "Дата+час; форматът зависи от това какво е върнал порталът.",
            "nullable": true,
            "title": "Подадено на",
            "type": "string"
          },
          "user": {
            "description": "Кой е подал (от извлечения header).",
            "nullable": true,
            "title": "Потребител",
            "type": "string"
          },
          "vies": {
            "description": "Парснат JSON на VIES, ако файлът присъства.",
            "nullable": true,
            "title": "VIES.TXT (JSON)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "VatPortalFileItem": {
        "properties": {
          "acceptance": {
            "description": "accepted — НАП е приела подаването; notAccepted — страницата с резултата не е уведомление за приемане (напр. уведомително писмо или корекция извън срок); unknown — страницата с резултата не можа да се прочете.",
            "enum": [
              "accepted",
              "notAccepted",
              "unknown"
            ],
            "title": "Приемане",
            "type": "string"
          },
          "content": {
            "description": "UTF-8 съдържание (декодирано от CP1251).",
            "title": "Съдържание",
            "type": "string"
          },
          "docId": {
            "description": "ipdoc_id на подадената декларация.",
            "title": "Document ID",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер на подаването.",
            "title": "Вх. номер",
            "type": "string"
          },
          "name": {
            "description": "Име на файла (DEKLAR.TXT / POKUPKI.TXT / …).",
            "title": "Име",
            "type": "string"
          },
          "period": {
            "description": "Период на декларацията — напр. „Март 2026 г.\".",
            "title": "Период",
            "type": "string"
          },
          "submittedAt": {
            "description": "Дата на подаване (както я рендерира порталът).",
            "title": "Подадено на",
            "type": "string"
          },
          "type": {
            "description": "declaration / purchases / sales / vies.",
            "title": "Тип",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type",
          "docId",
          "content",
          "incomeNumber",
          "submittedAt",
          "period",
          "acceptance"
        ],
        "type": "object"
      },
      "VatPortalFilesRequest": {
        "properties": {
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "month": {
            "description": "Месец от периода (1-12).",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "onlyDeclaration": {
            "default": "false",
            "description": "Когато е true, сваля само DEKLAR.TXT и пропуска POKUPKI / PRODAGBI / VIES.",
            "title": "Само DEKLAR.TXT",
            "type": "boolean"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year"
        ],
        "type": "object"
      },
      "VatPortalFilesResult": {
        "properties": {
          "acceptedCount": {
            "description": "Колко от тях са с acceptance = accepted.",
            "format": "int64",
            "nullable": true,
            "title": "Брой приети",
            "type": "integer"
          },
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "fileCount": {
            "description": "Брой успешно изтеглени файлове.",
            "format": "int64",
            "nullable": true,
            "title": "Брой файлове",
            "type": "integer"
          },
          "files": {
            "description": "Изтеглени DEKLAR / POKUPKI / PRODAGBI / VIES файлове на всички ДДС подавания, намерени в портала — и приетите, и неприетите, и по-старите подавания за вече покрит период. Без `month` идват всички подавания за годината. Всеки ред носи docId / incomeNumber / period / acceptance.",
            "items": {
              "$ref": "#/components/schemas/VatPortalFileItem"
            },
            "title": "Файлове",
            "type": "array"
          },
          "status": {
            "description": "ok при успех; error при липсваща декларация или HTTP грешка.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "submissionCount": {
            "description": "Брой подавания, чиито файлове са върнати — приети или не.",
            "format": "int64",
            "nullable": true,
            "title": "Брой подавания",
            "type": "integer"
          }
        },
        "required": [
          "files",
          "status"
        ],
        "type": "object"
      },
      "VatRequest": {
        "properties": {
          "_inlineDir": {
            "$ref": "#/components/schemas/InlineDir",
            "description": "Алтернатива на X-Napi-File-Path: подайте файловете директно в JSON-а (base64) вместо път до папка. Папката съдържа DEKLAR.TXT (задължителен), POKUPKI.TXT и PRODAGBI.TXT (може да са празни или да липсват) и VIES.TXT само при вътреобщностни доставки (ВОД) — това е ЕДНА декларация за един период и една фирма. Не е дърво с много декларации: за цяла папка ползвайте `vat_batch`, който сам намира всяка подпапка с DEKLAR.TXT за периода и я подава. Файловете се записват в napi_<random>/ под системния temp и се трият автоматично след handler-а."
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "iban": {
            "description": "IBAN за възстановяване; празно = без искане.",
            "title": "IBAN за възст.",
            "type": "string"
          },
          "month": {
            "description": "Месец от периода (1-12).",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "year": {
            "description": "Година на периода (напр. 2026).",
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "year",
          "month",
          "eik"
        ],
        "type": "object"
      },
      "VatResultRequest": {
        "properties": {
          "documentId": {
            "description": "ID на подадения документ — върнат от submit операцията като documentId.",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "description": "ЕИК / Булстат на задълженото лице (9 или 13 цифри).",
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "eik"
        ],
        "type": "object"
      },
      "VatSubmissionResult": {
        "properties": {
          "documentId": {
            "description": "Идентификатор на документа в НАП (pid / DOCID).",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "errorMessage": {
            "description": "Свободен текст с описание на грешката, ако има такава.",
            "nullable": true,
            "title": "Съобщение за грешка",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от НАП.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Технически грешки върнати от StampIT/Java pipe-а; празен масив при успех.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "title": "Native грешки",
            "type": "array"
          },
          "submissionDate": {
            "description": "Времеви маркер на подаването от страна на НАП.",
            "format": "date-time",
            "nullable": true,
            "title": "Дата на подаване",
            "type": "string"
          },
          "success": {
            "description": "true когато НАП прие декларацията.",
            "title": "Успех",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "type": "object"
      },
      "VatValidateRequest": {
        "properties": {
          "directory": {
            "description": "Път до папка с DEKLAR.TXT / POKUPKI.TXT / PRODAGBI.TXT",
            "title": "Папка с ДДС файлове",
            "type": "string"
          }
        },
        "required": [
          "directory"
        ],
        "type": "object"
      },
      "VatValidationMessage": {
        "properties": {
          "message": {
            "description": "Текст на грешката или потвърждение.",
            "title": "Съобщение",
            "type": "string"
          },
          "source": {
            "description": "Етапът, дал съобщението: preflight (локална проверка на файловете), auth (вход в НАП), bootstrap (сваляне/стартиране на валидатора), validator (самият StampIT валидатор).",
            "title": "Източник",
            "type": "string"
          }
        },
        "required": [
          "source",
          "message"
        ],
        "type": "object"
      },
      "VatValidationResult": {
        "properties": {
          "errorCount": {
            "description": "Брой validator-грешки (0 при ok).",
            "format": "int64",
            "title": "Брой грешки",
            "type": "integer"
          },
          "items": {
            "description": "Едно съобщение на ред — източник + текст.",
            "items": {
              "$ref": "#/components/schemas/VatValidationMessage"
            },
            "title": "Съобщения от валидатора",
            "type": "array"
          },
          "message": {
            "description": "Свободен текст; при unavailable обяснява защо.",
            "nullable": true,
            "title": "Бележка",
            "type": "string"
          },
          "status": {
            "description": "ok — файловете минават валидатора; invalid — валидаторът върна грешки (броят им е в `errorCount`); unavailable — валидаторът не може да бъде стартиран (напр. липсва Java) и причината е в `message`; error — неочакван проблем.",
            "enum": [
              "ok",
              "invalid",
              "unavailable",
              "error"
            ],
            "title": "Резултат",
            "type": "string"
          }
        },
        "required": [
          "items",
          "status",
          "errorCount"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "bearerFormat": "JWT",
        "description": "Submission token издаден от napi.bg (`POST /api/v1/tokens/issue`).",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Машинно-генерирана документация на REST API на NAPI Agent. Всяка операция (декларация / справка) се извиква на свой POST /api/v1/operations/<typeId> с typed входен и изходен JSON. Генерирайте client SDK с openapi-generator / NSwag / Swagger Codegen.",
    "title": "NAPI Agent API",
    "version": "0.1.16"
  },
  "openapi": "3.0.3",
  "paths": {
    "/api/senders": {
      "get": {
        "description": "Списък на подателите, настроени в агента на тази машина. Върнатият `id` се подава като `X-Napi-Sender-Id` на операция, за да не се избира подател на ръка. Не изисква токен и не връща сертификати, ЕГН или API ключове — само име и id, колкото да се нарисува избор в интерфейса на интегратора.",
        "operationId": "listSenders",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SenderList"
                }
              }
            },
            "description": "Подателите, в реда на създаването им."
          }
        },
        "summary": "Конфигурираните податели"
      }
    },
    "/api/v1/operations/debt_payments": {
      "post": {
        "description": "Списък на задълженията и плащанията за избрано ЗЛ и година, филтрируем по вид задължение.",
        "operationId": "debt_payments",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DebtPaymentsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DebtPaymentsResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Справка за задължения и плащания",
        "tags": [
          "payments"
        ]
      }
    },
    "/api/v1/operations/debt_payments_types": {
      "post": {
        "description": "Пълен списък на видовете задължения и плащания, поддържани от портала на НАП (за референция при филтриране на справките).",
        "operationId": "debt_payments_types",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DebtPaymentsTypesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DebtPaymentsTypesResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Типове дълг / плащания",
        "tags": [
          "payments"
        ]
      }
    },
    "/api/v1/operations/dec1_6": {
      "post": {
        "description": "Данни за осигуреното лице (обр. 1) и дължими вноски (обр. 6) през REST API на НАП.",
        "operationId": "dec1_6",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec16Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dec16SubmissionResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Декларации обр. 1 и 6",
        "tags": [
          "dec16"
        ]
      }
    },
    "/api/v1/operations/dec1_6_batch": {
      "post": {
        "description": "Обхожда папка (по избор рекурсивно), разпознава Д1 (EMPL2021) и Д6 файловете за зададения период по съдържанието им, сдвоява ги по ЕИК и период и подава всяка двойка поотделно. Връща по един ред на подаване с ЕИК, период, път, входящ номер и documentId. Подават се само ЕИК-овете, за които е издаден токенът.",
        "operationId": "dec1_6_batch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec16BatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dec16BatchResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Декларации обр. 1 и 6 — подаване на папка",
        "tags": [
          "dec16"
        ]
      }
    },
    "/api/v1/operations/dec1_6_portal_files": {
      "post": {
        "description": "Изтегля Д1 (EMPL2021) и Д6 (NRA62007) файловете на приетите декларации обр. 1 и 6 за избрана фирма. С `month` — за избрания месец; без `month` — за всички месеци от годината. Дублираните приети подавания за един период остават видими (счетоводна грешка за поправка). Връща съдържанието като UTF-8 текст (декодирано от CP1251).",
        "operationId": "dec1_6_portal_files",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec16PortalFilesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dec16PortalFilesResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Декларации обр. 1 и 6 — изтегляне на подадените файлове",
        "tags": [
          "dec16"
        ]
      }
    },
    "/api/v1/operations/dec1_6_result": {
      "post": {
        "description": "Изтегля HTML резултата за подадена декларация обр. 1 и 6 от публичния REST status endpoint на НАП. Изисква documentId върнат от submit операцията плюс ЕИК на данъчно задълженото лице.",
        "operationId": "dec1_6_result",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec16ResultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmissionResultPayload"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Декларации обр. 1 и 6 — резултат",
        "tags": [
          "dec16"
        ]
      }
    },
    "/api/v1/operations/dec1_files_scan": {
      "post": {
        "description": "Рекурсивно сканира папка за Д1 (EMPL2021) файлове и филтрира по месец/година от съдържанието.",
        "operationId": "dec1_files_scan",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec1FilesScanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dec1FilesScanResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Сканиране на Д1 файлове",
        "tags": [
          "dec1"
        ]
      }
    },
    "/api/v1/operations/dec6_files_scan": {
      "post": {
        "description": "Рекурсивно сканира папка за Д6 (NRA62007) файлове и филтрира по месец/година от съдържанието.",
        "operationId": "dec6_files_scan",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec6FilesScanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dec6FilesScanResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Сканиране на Д6 файлове",
        "tags": [
          "dec6"
        ]
      }
    },
    "/api/v1/operations/dec731": {
      "post": {
        "description": "Справка по чл. 73, ал. 1 от ЗДДФЛ за изплатени доходи на физически лица.",
        "operationId": "dec731",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec731Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dec731SubmissionResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Справка чл. 73, ал. 1 ЗДДФЛ",
        "tags": [
          "dec731"
        ]
      }
    },
    "/api/v1/operations/dec731_result": {
      "post": {
        "description": "Изтегля HTML на резултатната страница (showResult?pid=...) за подадена справка по чл. 73, ал. 1 ЗДДФЛ по documentId.",
        "operationId": "dec731_result",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec731ResultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmissionResultPayload"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Справка чл. 73, ал. 1 ЗДДФЛ — резултат",
        "tags": [
          "dec731"
        ]
      }
    },
    "/api/v1/operations/dec736": {
      "post": {
        "description": "Справка по чл. 73, ал. 6 от ЗДДФЛ за изплатени доходи по трудови правоотношения.",
        "operationId": "dec736",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec736Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dec736SubmissionResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Справка чл. 73, ал. 6 ЗДДФЛ",
        "tags": [
          "dec736"
        ]
      }
    },
    "/api/v1/operations/dec736_result": {
      "post": {
        "description": "Изтегля HTML на резултатната страница (showResult?pid=...) за подадена справка по чл. 73, ал. 6 ЗДДФЛ по documentId.",
        "operationId": "dec736_result",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec736ResultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmissionResultPayload"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Справка чл. 73, ал. 6 ЗДДФЛ — резултат",
        "tags": [
          "dec736"
        ]
      }
    },
    "/api/v1/operations/dec92": {
      "post": {
        "description": "Годишна данъчна декларация по чл. 92 от ЗКПО за корпоративния данък.",
        "operationId": "dec92",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec92Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dec92SubmissionResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "ГДД по чл. 92 ЗКПО",
        "tags": [
          "dec92"
        ]
      }
    },
    "/api/v1/operations/dec92_document": {
      "post": {
        "description": "Изтегля HTML прегледа на подадена ГДД по чл. 92 (viewDocument?pdoc_id=...). documentId = declarationDocId от dec92_submitted.",
        "operationId": "dec92_document",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec92DocumentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dec92DocumentResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "ГДД по чл. 92 — преглед на декларацията",
        "tags": [
          "dec92"
        ]
      }
    },
    "/api/v1/operations/dec92_pdf": {
      "post": {
        "description": "Изтегля PDF на подадена ГДД по чл. 92 (download?ipsystem_id=...&ipendpoint_id=2&ipdoc_id=...). Връща байтовете base64-кодирани в rawBody (encoding=base64). documentId = declarationDocId от dec92_submitted.",
        "operationId": "dec92_pdf",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec92PdfRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dec92DocumentResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "ГДД по чл. 92 — PDF на декларацията",
        "tags": [
          "dec92"
        ]
      }
    },
    "/api/v1/operations/dec92_result": {
      "post": {
        "description": "Изтегля HTML на резултатната страница (showResult?pid=...) за подадена ГДД по чл. 92 ЗКПО по documentId.",
        "operationId": "dec92_result",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec92ResultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmissionResultPayload"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "ГДД по чл. 92 ЗКПО — резултат",
        "tags": [
          "dec92"
        ]
      }
    },
    "/api/v1/operations/dec92_submitted": {
      "post": {
        "description": "Списък на подадените годишни данъчни декларации по чл. 92 ЗКПО за избрана фирма. Без `year` — всички години; с `year` — само тази. Всеки ред носи declarationDocId (за dec92_document / dec92_pdf) и resultDocId (за dec92_result).",
        "operationId": "dec92_submitted",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Dec92SubmittedRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dec92SubmittedResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "ГДД по чл. 92 — подадени декларации",
        "tags": [
          "dec92"
        ]
      }
    },
    "/api/v1/operations/due_amounts": {
      "post": {
        "description": "Списък на дължими суми (главница, лихва) към дадена дата.",
        "operationId": "due_amounts",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DueAmountsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DueAmountsResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Справка за дължими суми",
        "tags": [
          "dueAmounts"
        ]
      }
    },
    "/api/v1/operations/eetz_business_records": {
      "post": {
        "description": "Изтегля актуалните електронни трудови записи на избрана фирма от регистъра на заетостта — заплата, длъжност по НКПД, икономическа дейност, работно време, платен отпуск, дати на сключване и прекратяване. Кодовете идват вече разчетени като наименования. По подразбиране връща само действащите записи; с `activeOnly=false` връща и прекратените. Без `employeePin` периодът е ограничен до една година, както го изисква порталът.",
        "operationId": "eetz_business_records",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EetzBusinessRecordsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EetzBusinessRecordsResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Електронен трудов запис — актуални записи за фирма",
        "tags": [
          "eetz"
        ]
      }
    },
    "/api/v1/operations/etz123": {
      "post": {
        "description": "Промяна на работодателя по чл. 123 КТ. На заявка се подава един файл; за цяла папка ползвайте `etz123_batch`.",
        "operationId": "etz123",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Etz123Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Etz123SubmissionResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Уведомление чл. 123 КТ",
        "tags": [
          "etz123"
        ]
      }
    },
    "/api/v1/operations/etz123_batch": {
      "post": {
        "description": "Обхожда папка (по избор рекурсивно), разпознава по корена на XML-а кои файлове са уведомления по чл. 123 КТ, чете ЕИК-а от всеки файл и го подава поотделно. Уведомленията нямат данъчен период, затова няма филтър по година и месец. Връща по един ред на файл с ЕИК, път, входящ номер и documentId. Подават се само ЕИК-овете, за които е издаден токенът.",
        "operationId": "etz123_batch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Etz123BatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Etz123BatchResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Уведомление чл. 123 КТ — подаване на папка",
        "tags": [
          "etz123"
        ]
      }
    },
    "/api/v1/operations/etz123_portal_files": {
      "post": {
        "description": "Изтегля подписаните XML файлове на подадените уведомления по чл. 123 КТ за избрана фирма. С `month` — подадените през този месец; без `month` — за цялата година. Филтърът е по дата на подаване (уведомленията нямат данъчен период). Връща съдържанието на всеки файл като текст плюс входящия номер и file id за повторно сваляне.",
        "operationId": "etz123_portal_files",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Etz123PortalFilesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Etz123PortalFilesResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Уведомление чл. 123 КТ — изтегляне на подадените файлове",
        "tags": [
          "etz123"
        ]
      }
    },
    "/api/v1/operations/etz123_result": {
      "post": {
        "description": "Изтегля HTML резултата за подадено уведомление чл. 123 КТ от публичния REST status endpoint на НАП. Изисква documentId върнат от submit операцията плюс ЕИК на данъчно задълженото лице.",
        "operationId": "etz123_result",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Etz123ResultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmissionResultPayload"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Уведомление чл. 123 КТ — резултат",
        "tags": [
          "etz123"
        ]
      }
    },
    "/api/v1/operations/etz62": {
      "post": {
        "description": "Трудови договори и тяхното изменение / прекратяване по чл. 62 КТ. На заявка се подава един файл; за цяла папка ползвайте `etz62_batch`.",
        "operationId": "etz62",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Etz62Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Etz62SubmissionResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Уведомление чл. 62 КТ",
        "tags": [
          "etz62"
        ]
      }
    },
    "/api/v1/operations/etz62_batch": {
      "post": {
        "description": "Обхожда папка (по избор рекурсивно), разпознава по корена на XML-а кои файлове са уведомления по чл. 62 КТ, чете ЕИК-а от всеки файл и го подава поотделно. Уведомленията нямат данъчен период, затова няма филтър по година и месец. Връща по един ред на файл с ЕИК, път, входящ номер и documentId. Подават се само ЕИК-овете, за които е издаден токенът.",
        "operationId": "etz62_batch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Etz62BatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Etz62BatchResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Уведомление чл. 62 КТ — подаване на папка",
        "tags": [
          "etz62"
        ]
      }
    },
    "/api/v1/operations/etz62_portal_files": {
      "post": {
        "description": "Изтегля подписаните XML файлове на подадените уведомления по чл. 62 КТ за избрана фирма. С `month` — подадените през този месец; без `month` — за цялата година. Филтърът е по дата на подаване (уведомленията нямат данъчен период). Връща съдържанието на всеки файл като текст плюс входящия номер и file id за повторно сваляне.",
        "operationId": "etz62_portal_files",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Etz62PortalFilesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Etz62PortalFilesResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Уведомление чл. 62 КТ — изтегляне на подадените файлове",
        "tags": [
          "etz62"
        ]
      }
    },
    "/api/v1/operations/etz62_result": {
      "post": {
        "description": "Изтегля HTML резултата за подадено уведомление чл. 62 КТ от публичния REST status endpoint на НАП. Изисква documentId върнат от submit операцията плюс ЕИК на данъчно задълженото лице.",
        "operationId": "etz62_result",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Etz62ResultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmissionResultPayload"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Уведомление чл. 62 КТ — резултат",
        "tags": [
          "etz62"
        ]
      }
    },
    "/api/v1/operations/high_fisc_risk": {
      "post": {
        "description": "Предварително деклариране на превози на стоки с висок фискален риск.",
        "operationId": "high_fisc_risk",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HighFiscRiskRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HighFiscRiskSubmissionResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Стоки висок фискален риск",
        "tags": [
          "highFiscRisk"
        ]
      }
    },
    "/api/v1/operations/high_fisc_risk_result": {
      "post": {
        "description": "Изтегля HTML резултата за подадена декларация Стоки с висок фискален риск от публичния REST status endpoint на НАП. Изисква documentId върнат от submit операцията плюс ЕИК на данъчно задълженото лице.",
        "operationId": "high_fisc_risk_result",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HighFiscRiskResultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmissionResultPayload"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Стоки висок фискален риск — резултат",
        "tags": [
          "highFiscRisk"
        ]
      }
    },
    "/api/v1/operations/high_fisc_risk_show": {
      "post": {
        "description": "Взема резултатния файл (HTML) на подадена декларация „Стоки с висок фискален риск“ от публичния portal.nra.bg showDocument endpoint. Изисква documentId (pdoc_id) върнат от submit операцията + ЕИК.",
        "operationId": "high_fisc_risk_show",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HighFiscRiskShowRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HighFiscRiskShowResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Стоки висок фискален риск — резултатен файл",
        "tags": [
          "highFiscRisk"
        ]
      }
    },
    "/api/v1/operations/nap_catalog": {
      "post": {
        "description": "Плосък списък на категории, услуги и линкове от `GET /api/base/categories`. Използва се за откриване на наличните справки и техните serviceId-та.",
        "operationId": "nap_catalog",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NapCatalogRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NapCatalogResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Списък на всички справки и услуги (NAP catalog)",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/operations/odit": {
      "post": {
        "description": "Стандартизиран одиторски файл по чл. 3, ал. 17 от Наредба Н-18/2006.",
        "operationId": "odit",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OditRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OditSubmissionResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Одиторски файл чл. 3, ал. 17 Н-18",
        "tags": [
          "odit"
        ]
      }
    },
    "/api/v1/operations/odit_result": {
      "post": {
        "description": "Връща JSON с информацията за подаден одиторски файл по documentId, извлечена от листинга на портала.",
        "operationId": "odit_result",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OditResultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OditResultPayload"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Одиторски файл чл. 3, ал. 17 Н-18 — резултат",
        "tags": [
          "odit"
        ]
      }
    },
    "/api/v1/operations/save_file": {
      "post": {
        "description": "Записва файл с подадено съдържание на подаден път (създава папките при нужда).",
        "operationId": "save_file",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveFileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveFileResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Запис на файл",
        "tags": [
          "files"
        ]
      }
    },
    "/api/v1/operations/taxpayers": {
      "post": {
        "description": "Списък на ЗЛ-тата, за които влезлият потребител има пълномощно в НАП. Не приема параметри — показва всичко, върнато от `GET /api/base/taxpayers` след КЕП логин.",
        "operationId": "taxpayers",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxpayersRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxpayersResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Задължени лица (достъпни с текущия сертификат)",
        "tags": [
          "taxpayers"
        ]
      }
    },
    "/api/v1/operations/vat": {
      "post": {
        "description": "Месечна ДДС декларация с покупки и продажби (DEKLAR.TXT + POKUPKI.TXT + PRODAGBI.TXT).",
        "operationId": "vat",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VatSubmissionResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "ДДС декларация",
        "tags": [
          "vat"
        ]
      }
    },
    "/api/v1/operations/vat_batch": {
      "post": {
        "description": "Обхожда дърво от папки, разпознава всяка папка с DEKLAR.TXT като отделна ДДС декларация, чете ЕИК и период от файла и подава само тези за зададения период. Връща по един ред на декларация с ЕИК, период, папка, входящ номер и documentId. Подават се само ЕИК-овете, за които е издаден токенът.",
        "operationId": "vat_batch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VatBatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VatBatchResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "ДДС — подаване на папка с декларации",
        "tags": [
          "vat"
        ]
      }
    },
    "/api/v1/operations/vat_files_parse": {
      "post": {
        "description": "Чете DEKLAR.TXT / POKUPKI.TXT / PRODAGBI.TXT от избрана папка и ги преобразува в JSON.",
        "operationId": "vat_files_parse",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VatFilesParseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VatFilesParseResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Парсване на ДДС файлове",
        "tags": [
          "vat"
        ]
      }
    },
    "/api/v1/operations/vat_files_scan": {
      "post": {
        "description": "Рекурсивно сканира папка за DEKLAR.TXT / POKUPKI.TXT / PRODAGBI.TXT и филтрира по период.",
        "operationId": "vat_files_scan",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VatFilesScanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VatFilesScanResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Сканиране на ДДС файлове",
        "tags": [
          "vat"
        ]
      }
    },
    "/api/v1/operations/vat_monthly_files": {
      "post": {
        "description": "Изтегля приетите ДДС справки-декларации и дневници и ги парсва в един JSON. С `month` — за избрания месец; без `month` — за всички месеци от годината (latest accepted на месец).",
        "operationId": "vat_monthly_files",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VatMonthlyFilesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VatMonthlyFilesResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "ДДС — подадени файлове за месец",
        "tags": [
          "vat"
        ]
      }
    },
    "/api/v1/operations/vat_portal_files": {
      "post": {
        "description": "Изтегля DEKLAR.TXT / POKUPKI.TXT / PRODAGBI.TXT / VIES.TXT от portal.nra.bg за приетите ДДС декларации. С `month` — за избрания месец; без `month` — за всички месеци от годината (latest accepted на месец).",
        "operationId": "vat_portal_files",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VatPortalFilesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VatPortalFilesResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "ДДС — изтегляне на резултатни файлове от портала",
        "tags": [
          "vat"
        ]
      }
    },
    "/api/v1/operations/vat_result": {
      "post": {
        "description": "Изтегля HTML на резултатната страница от portal.nra.bg по documentId на подадена ДДС декларация.",
        "operationId": "vat_result",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VatResultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmissionResultPayload"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "ДДС — резултат от подадена декларация",
        "tags": [
          "vat"
        ]
      }
    },
    "/api/v1/operations/vat_validate": {
      "post": {
        "description": "Проверява DEKLAR.TXT / POKUPKI.TXT / PRODAGBI.TXT с официалния StampIT валидатор, без да подава нищо в НАП.",
        "operationId": "vat_validate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VatValidateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VatValidationResult"
                }
              }
            },
            "description": "Успешно изпълнение."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Невалиден / липсващ JWT (когато операцията изисква EIK)."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateRequired"
                }
              }
            },
            "description": "Cloud-ът изисква по-нова версия на агента — или публикуваната минимална версия, или `min_ver` claim-ът на токена не е удовлетворен."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Валидация на ДДС файлове",
        "tags": [
          "vat"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "NAPI Agent (locally running)",
      "url": "http://127.0.0.1:5123"
    }
  ],
  "tags": [
    {
      "description": "Задължения и плащания",
      "name": "payments"
    },
    {
      "description": "Декларации обр. 1 и 6",
      "name": "dec16"
    },
    {
      "description": "Д1 (Осигурени лица)",
      "name": "dec1"
    },
    {
      "description": "Д6 (Дължими вноски и данък)",
      "name": "dec6"
    },
    {
      "description": "Справка чл. 73, ал. 1 ЗДДФЛ",
      "name": "dec731"
    },
    {
      "description": "Справка чл. 73, ал. 6 ЗДДФЛ",
      "name": "dec736"
    },
    {
      "description": "ГДД по чл. 92 ЗКПО",
      "name": "dec92"
    },
    {
      "description": "Дължими суми",
      "name": "dueAmounts"
    },
    {
      "description": "Електронен трудов запис",
      "name": "eetz"
    },
    {
      "description": "Уведомление чл. 123 КТ",
      "name": "etz123"
    },
    {
      "description": "Уведомление чл. 62 КТ",
      "name": "etz62"
    },
    {
      "description": "Стоки висок фискален риск",
      "name": "highFiscRisk"
    },
    {
      "description": "Каталог НАП",
      "name": "catalog"
    },
    {
      "description": "Одиторски файл",
      "name": "odit"
    },
    {
      "description": "Файлове",
      "name": "files"
    },
    {
      "description": "Задължени лица",
      "name": "taxpayers"
    },
    {
      "description": "ДДС",
      "name": "vat"
    }
  ]
}
