{
  "components": {
    "schemas": {
      "AgentError": {
        "properties": {
          "error": {
            "description": "Описание на грешката.",
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "AgentUpdateRequired": {
        "description": "Връща се с HTTP 426 когато cloud-ът изисква по-нова версия на агента.",
        "properties": {
          "agentVersion": {
            "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": "Неплатен остатък по главницата.",
            "format": "double",
            "title": "Остатък",
            "type": "number"
          },
          "outstandingInterest": {
            "description": "Начислени лихви върху остатъка.",
            "format": "double",
            "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",
          "outstandingAmount",
          "outstandingInterest"
        ],
        "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": {
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "type": {
            "default": "0",
            "description": "0 = всички видове; друго = id от debt_payments_types",
            "title": "Вид",
            "type": "string"
          },
          "year": {
            "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.",
            "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.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "items",
          "status",
          "rowCount"
        ],
        "type": "object"
      },
      "Dec16PortalFileItem": {
        "properties": {
          "content": {
            "description": "UTF-8 съдържание (декодирано от CP1251).",
            "title": "Съдържание",
            "type": "string"
          },
          "docFileId": {
            "description": "ID на подписания файл в портала.",
            "title": "File ID",
            "type": "string"
          },
          "name": {
            "description": "Канонично име на файла (EMPL2021.TXT / NRA62007.TXT).",
            "title": "Име",
            "type": "string"
          },
          "type": {
            "description": "dec1 / dec6.",
            "title": "Тип",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type",
          "docFileId",
          "content"
        ],
        "type": "object"
      },
      "Dec16PortalFilesRequest": {
        "properties": {
          "eik": {
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "month": {
            "description": "1-12",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "year": {
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year",
          "month"
        ],
        "type": "object"
      },
      "Dec16PortalFilesResult": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "files": {
            "description": "Изтеглени Д1 (EMPL2021) и Д6 (NRA62007) файлове.",
            "items": {
              "$ref": "#/components/schemas/Dec16PortalFileItem"
            },
            "title": "Файлове",
            "type": "array"
          },
          "incomeNumber": {
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "period": {
            "description": "Например „Март 2026\".",
            "nullable": true,
            "title": "Период",
            "type": "string"
          },
          "status": {
            "description": "ok при успех; error при липсваща декларация или HTTP грешка.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "submissionId": {
            "description": "ID на цялото подаване (Д1+Д6) в портала.",
            "nullable": true,
            "title": "Submission ID",
            "type": "string"
          },
          "submittedAt": {
            "description": "ISO-8601 timestamp от entryDate.",
            "nullable": true,
            "title": "Подадено на",
            "type": "string"
          }
        },
        "required": [
          "files",
          "status"
        ],
        "type": "object"
      },
      "Dec16Request": {
        "properties": {
          "dec1FilePath": {
            "description": "Път до Д1 файл. Поне един от dec1FilePath / dec6FilePath е задължителен; ако са подадени и двата, трябва да са за един и същ ЕИК.",
            "title": "Файл Д1 (EMPL2021)",
            "type": "string"
          },
          "dec6FilePath": {
            "description": "Път до Д6 файл.",
            "title": "Файл Д6",
            "type": "string"
          },
          "eik": {
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "fund": {
            "title": "Осигурителна каса",
            "type": "boolean"
          },
          "month": {
            "description": "1-12",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "year": {
            "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": {
            "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": "Входящ номер върнат от portal.nra.bg.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Грешки върнати от Java/StampIT 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"
      },
      "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": {
            "description": "1-12",
            "format": "int64",
            "title": "Месец",
            "type": "integer"
          },
          "recursive": {
            "default": "true",
            "title": "Рекурсивно",
            "type": "boolean"
          },
          "rootFolder": {
            "description": "Папка за рекурсивно сканиране.",
            "title": "Папка",
            "type": "string"
          },
          "year": {
            "format": "int64",
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "rootFolder",
          "year",
          "month"
        ],
        "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": {
            "description": "1-12",
            "format": "int64",
            "title": "Месец",
            "type": "integer"
          },
          "recursive": {
            "default": "true",
            "title": "Рекурсивно",
            "type": "boolean"
          },
          "rootFolder": {
            "description": "Папка за рекурсивно сканиране.",
            "title": "Папка",
            "type": "string"
          },
          "year": {
            "format": "int64",
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "rootFolder",
          "year",
          "month"
        ],
        "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": {
          "eik": {
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "year": {
            "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": {
            "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": "Входящ номер върнат от portal.nra.bg.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Грешки върнати от Java/StampIT 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"
      },
      "Dec736Request": {
        "properties": {
          "eik": {
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "year": {
            "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": {
            "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": "Входящ номер върнат от portal.nra.bg.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Грешки върнати от Java/StampIT 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"
      },
      "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": "Неплатен остатък по главницата.",
            "format": "double",
            "title": "Остатък за плащане",
            "type": "number"
          },
          "outstandingInterest": {
            "description": "Начислени лихви върху неплатения остатък.",
            "format": "double",
            "title": "Начислени лихви",
            "type": "number"
          }
        },
        "required": [
          "debtTypeName",
          "documentType",
          "documentNumber",
          "dueAmount",
          "outstandingAmount",
          "outstandingInterest"
        ],
        "type": "object"
      },
      "DueAmountsRequest": {
        "properties": {
          "eik": {
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "year": {
            "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 по всички записи.",
            "format": "double",
            "title": "Общи лихви",
            "type": "number"
          },
          "totalOutstanding": {
            "description": "Сбор на outstandingAmount по всички записи.",
            "format": "double",
            "title": "Общ остатък",
            "type": "number"
          },
          "year": {
            "description": "Годината, за която е поискана справката.",
            "format": "int64",
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "totalOutstanding",
          "totalInterest",
          "year",
          "rowCount",
          "status"
        ],
        "type": "object"
      },
      "Etz123Request": {
        "properties": {
          "eik": {
            "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": {
            "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": "Входящ номер върнат от portal.nra.bg.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Грешки върнати от Java/StampIT 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"
      },
      "Etz62Request": {
        "properties": {
          "eik": {
            "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": {
            "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": "Входящ номер върнат от portal.nra.bg.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Грешки върнати от Java/StampIT 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"
      },
      "HighFiscRiskRequest": {
        "properties": {
          "eik": {
            "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": {
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "eik"
        ],
        "type": "object"
      },
      "HighFiscRiskSubmissionResult": {
        "properties": {
          "documentId": {
            "description": "Идентификатор на документа в портала (pid / DOCID).",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "errorMessage": {
            "description": "Свободен текст с описание на грешката, ако има такава.",
            "nullable": true,
            "title": "Съобщение за грешка",
            "type": "string"
          },
          "incomeNumber": {
            "description": "Входящ номер върнат от portal.nra.bg.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Грешки върнати от Java/StampIT 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"
      },
      "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": {
          "eik": {
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "month": {
            "description": "1-12",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "year": {
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year",
          "month"
        ],
        "type": "object"
      },
      "OditResultRequest": {
        "properties": {
          "documentId": {
            "description": "ID на подадения документ — върнат от submit операцията като documentId.",
            "title": "Document ID",
            "type": "string"
          },
          "eik": {
            "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": "Входящ номер върнат от portal.nra.bg.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Грешки върнати от Java/StampIT 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"
      },
      "SubmissionResultPayload": {
        "properties": {
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "rawBody": {
            "description": "HTML / JSON / TXT върнат от portal.nra.bg за това подаване.",
            "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": {
            "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.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          }
        },
        "required": [
          "items",
          "status",
          "count"
        ],
        "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.",
            "enum": [
              "ok",
              "partial",
              "error"
            ],
            "title": "Общ статус",
            "type": "string"
          }
        },
        "required": [
          "items",
          "status",
          "directory"
        ],
        "type": "object"
      },
      "VatFilesScanRequest": {
        "properties": {
          "month": {
            "description": "1-12",
            "format": "int64",
            "title": "Месец",
            "type": "integer"
          },
          "recursive": {
            "default": "true",
            "title": "Рекурсивно",
            "type": "boolean"
          },
          "rootFolder": {
            "description": "Папка за рекурсивно сканиране.",
            "title": "Папка",
            "type": "string"
          },
          "year": {
            "format": "int64",
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "rootFolder",
          "year",
          "month"
        ],
        "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": {
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "month": {
            "description": "1-12",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "year": {
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year",
          "month"
        ],
        "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.",
            "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": {
          "content": {
            "description": "UTF-8 съдържание (декодирано от CP1251).",
            "title": "Съдържание",
            "type": "string"
          },
          "docId": {
            "description": "ipdoc_id на подадената декларация.",
            "title": "Document ID",
            "type": "string"
          },
          "name": {
            "description": "Име на файла (DEKLAR.TXT / POKUPKI.TXT / …).",
            "title": "Име",
            "type": "string"
          },
          "type": {
            "description": "declaration / purchases / sales / vies.",
            "title": "Тип",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type",
          "docId",
          "content"
        ],
        "type": "object"
      },
      "VatPortalFilesRequest": {
        "properties": {
          "eik": {
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "month": {
            "description": "1-12",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "year": {
            "maximum": 2999,
            "minimum": 1900,
            "title": "Година",
            "type": "integer"
          }
        },
        "required": [
          "eik",
          "year",
          "month"
        ],
        "type": "object"
      },
      "VatPortalFilesResult": {
        "properties": {
          "docId": {
            "description": "ipdoc_id на резултатната декларация.",
            "nullable": true,
            "title": "Document ID",
            "type": "string"
          },
          "error": {
            "description": "Текст на грешката когато status=error.",
            "nullable": true,
            "title": "Грешка",
            "type": "string"
          },
          "files": {
            "description": "Изтеглени DEKLAR / POKUPKI / PRODAGBI / VIES файлове.",
            "items": {
              "$ref": "#/components/schemas/VatPortalFileItem"
            },
            "title": "Файлове",
            "type": "array"
          },
          "incomeNumber": {
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "period": {
            "nullable": true,
            "title": "Период",
            "type": "string"
          },
          "status": {
            "description": "ok при успех; error при липсваща декларация или HTTP грешка.",
            "enum": [
              "ok",
              "error"
            ],
            "title": "Статус",
            "type": "string"
          },
          "submittedAt": {
            "nullable": true,
            "title": "Подадено на",
            "type": "string"
          }
        },
        "required": [
          "files",
          "status"
        ],
        "type": "object"
      },
      "VatRequest": {
        "properties": {
          "eik": {
            "pattern": "^[0-9]{9,13}$",
            "title": "ЕИК / Булстат",
            "type": "string"
          },
          "iban": {
            "title": "IBAN за възст.",
            "type": "string"
          },
          "month": {
            "description": "1-12",
            "maximum": 12,
            "minimum": 1,
            "title": "Месец",
            "type": "integer"
          },
          "year": {
            "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": {
            "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": "Входящ номер върнат от portal.nra.bg.",
            "nullable": true,
            "title": "Вх. номер",
            "type": "string"
          },
          "nativeErrors": {
            "description": "Грешки върнати от Java/StampIT 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.",
            "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 / unavailable / 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.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/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` JWT 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` JWT claim не е удовлетворен)."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "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` JWT 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 за избрана фирма, година и месец. Връща съдържанието като 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` JWT 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 от https://public-api.nra.bg/declaration/api-declarations/result. Изисква 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` JWT 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` JWT 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` JWT 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` JWT 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` JWT 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` JWT 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` JWT claim не е удовлетворен)."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Справка чл. 73, ал. 6 ЗДДФЛ — резултат",
        "tags": [
          "dec736"
        ]
      }
    },
    "/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` JWT claim не е удовлетворен)."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Справка за дължими суми",
        "tags": [
          "dueAmounts"
        ]
      }
    },
    "/api/v1/operations/etz123": {
      "post": {
        "description": "Промяна на работодателя по чл. 123 КТ.",
        "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` JWT 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 КТ от https://public-api.nra.bg/declaration/api-declarations/result. Изисква 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` JWT claim не е удовлетворен)."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Уведомление чл. 123 КТ — резултат",
        "tags": [
          "etz123"
        ]
      }
    },
    "/api/v1/operations/etz62": {
      "post": {
        "description": "Трудови договори и тяхното изменение / прекратяване по чл. 62 КТ.",
        "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` JWT 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 КТ от https://public-api.nra.bg/declaration/api-declarations/result. Изисква 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` JWT 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` JWT 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 резултата за подадена декларация Стоки с висок фискален риск от https://public-api.nra.bg/declaration/api-declarations/result. Изисква 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` JWT 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` JWT claim не е удовлетворен)."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "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` JWT 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/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` JWT claim не е удовлетворен)."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Одиторски файл чл. 3, ал. 17 Н-18 — резултат",
        "tags": [
          "odit"
        ]
      }
    },
    "/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` JWT claim не е удовлетворен)."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "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` JWT 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` JWT 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` JWT 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.",
        "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` JWT 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 за последно приетата ДДС декларация за избрания месец и година.",
        "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` JWT 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` JWT 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` JWT claim не е удовлетворен)."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentError"
                }
              }
            },
            "description": "Грешка при изпълнение на операцията (портал / валидация)."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Валидация на ДДС файлове",
        "tags": [
          "vat"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "NAPI Agent (locally running, port 5123)",
      "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": "Дължими суми",
      "name": "dueAmounts"
    },
    {
      "description": "Уведомление чл. 123 КТ",
      "name": "etz123"
    },
    {
      "description": "Уведомление чл. 62 КТ",
      "name": "etz62"
    },
    {
      "description": "Стоки висок фискален риск",
      "name": "highFiscRisk"
    },
    {
      "description": "Каталог НАП",
      "name": "catalog"
    },
    {
      "description": "Одиторски файл",
      "name": "odit"
    },
    {
      "description": "Задължени лица",
      "name": "taxpayers"
    },
    {
      "description": "ДДС",
      "name": "vat"
    }
  ]
}
