{
  "openapi": "3.0.4",
  "info": {
    "title": "SOFTIP Digitálny poštár API",
    "description": "Machine-to-machine REST API of SOFTIP Digitálny poštár for integrating customer software: sending and receiving Peppol business documents.\n\nAuthentication: JWT (Keycloak) or API Key.\nKeycloak base URL: https://keycloak.test.softipdigitalnypostar.sk/\nRealm: postar\nToken endpoint (password / client credentials): https://keycloak.test.softipdigitalnypostar.sk/realms/postar/protocol/openid-connect/token\n\nClient credentials example:\ncurl -X POST \"https://keycloak.test.softipdigitalnypostar.sk/realms/postar/protocol/openid-connect/token\" \\\n  -H \"Content-Type: application/x-www-form-urlencoded\" \\\n  -d \"grant_type=client_credentials&client_id=<client-id>&client_secret=<secret>\"\n\nAfter obtaining the access token, click Authorize -> bearer and paste it as 'Bearer <token>'.\nFor API key access, provide header X-API-KEY in the Authorize dialog.",
    "version": "1.0"
  },
  "paths": {
    "/api/v1/auth/user": {
      "get": {
        "tags": [
          "Auth"
        ],
        "summary": "Return user name (email address) by authentication",
        "operationId": "GetAuthenticatedUser",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.UserModel"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/document/send": {
      "post": {
        "tags": [
          "Document"
        ],
        "summary": "Send document to Digitálny poštár",
        "operationId": "SendDocument",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key for idempotent document submission. Same key + same payload returns the original response. Same key + different payload returns 409 Conflict. Keys expire after 24 hours.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "File"
                ],
                "type": "object",
                "properties": {
                  "File": {
                    "type": "string",
                    "format": "binary"
                  },
                  "SkipValidation": {
                    "type": "boolean",
                    "description": "When true, XSD, UBL, and Schematron validation are skipped on ingestion.\nThe document will be fully validated before it is sent by the background processing pipeline."
                  },
                  "Tag": {
                    "maxLength": 50,
                    "type": "string",
                    "description": "A custom tag attached to a document submission transaction. \nThe tag can be used to later search for a transaction or view statistics on the results of document submissions with the same tag.",
                    "nullable": true
                  }
                }
              },
              "encoding": {
                "File": {
                  "style": "form"
                },
                "SkipValidation": {
                  "style": "form"
                },
                "Tag": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.DocumentSendResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/document/send-json": {
      "post": {
        "tags": [
          "Document"
        ],
        "summary": "Send document to Digitálny poštár as a JSON body (application/json).\nFunctionally equivalent to `POST send` (multipart/form-data).",
        "description": "The XML document is passed as a plain JSON string in the `file` element (not base64-encoded).\nThe document must be UTF-8 encoded: the XML prolog must not declare any other encoding\n(e.g. `encoding=\"windows-1250\"` or `UTF-16`), otherwise the request is rejected with 400.\nDocuments in other encodings must be sent via the multipart `POST send` endpoint.",
        "operationId": "SendDocumentJson",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key for idempotent document submission. Same key + same payload returns the original response. Same key + different payload returns 409 Conflict. Keys expire after 24 hours.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "UTF-8 XML document text with optional skipValidation and tag.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.DocumentSendJsonRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.DocumentSendResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/document/validate": {
      "post": {
        "tags": [
          "Document"
        ],
        "summary": "Validate XML document through all standard validation stages: file rules, SBDH XSD,\nUBL schema, and Schematron business rules. Returns a full validation report without\ncreating a transaction or delivering the document.",
        "operationId": "ValidateDocument",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "File"
                ],
                "type": "object",
                "properties": {
                  "File": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              },
              "encoding": {
                "File": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.DocumentValidateResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/health/heartbeat": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Returns a heartbeat response to verify that the service is alive.",
        "operationId": "GetHealthHeartbeat",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          }
        },
        "security": [ ]
      }
    },
    "/api/v1/health/version": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Returns the current version of the service as defined in the project file.",
        "operationId": "GetHealthVersion",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          }
        },
        "security": [ ]
      }
    },
    "/api/v1/in-transaction/acknowledge/{id}": {
      "put": {
        "tags": [
          "IncomingTransaction"
        ],
        "summary": "Set status to ACKNOWLEDGED and get detail of transaction by id.",
        "description": "Returns detail of transaction and mark transaction as ACKNOWLEDGED.",
        "operationId": "AcknowledgeIncomingTransaction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransaction"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransaction"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransaction"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/in-transaction/{id}": {
      "get": {
        "tags": [
          "IncomingTransaction"
        ],
        "summary": "Get detail of transaction by id.",
        "description": "Returns detail of transaction and mark transaction as READ.",
        "operationId": "GetIncomingTransaction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "events",
            "in": "query",
            "description": "Flag for requesting transaction events",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransaction"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransaction"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransaction"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "IncomingTransaction"
        ],
        "summary": "Soft delete transaction by id.",
        "operationId": "DeleteIncomingTransaction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/in-transaction/download-doc/{id}": {
      "get": {
        "tags": [
          "IncomingTransaction"
        ],
        "summary": "Download transaction document",
        "description": "Download document and mark transaction as DOWNLOADED.",
        "operationId": "DownloadIncomingTransactionDoc",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "sbd",
            "in": "header",
            "description": "Optional, default `true`. When `false`, returns only the inner\nbusiness document instead of the full StandardBusinessDocument.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/in-transaction/download-pdf/{id}": {
      "get": {
        "tags": [
          "IncomingTransaction"
        ],
        "summary": "Download transaction document in PDF format.",
        "description": "Download document and mark transaction as DOWNLOADED.",
        "operationId": "DownloadIncomingTransactionPdf",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/in-transaction/download-html/{id}": {
      "get": {
        "tags": [
          "IncomingTransaction"
        ],
        "summary": "Download transaction document in HTML format.",
        "description": "Download document and mark transaction as DOWNLOADED.",
        "operationId": "DownloadIncomingTransactionHtml",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/in-transaction/download-rcp/{id}": {
      "get": {
        "tags": [
          "IncomingTransaction"
        ],
        "summary": "Download transaction document recepient",
        "description": "Download document and mark transaction as DOWNLOADED.",
        "operationId": "DownloadIncomingTransactionRcp",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/in-transaction/download-mls/{id}": {
      "get": {
        "tags": [
          "IncomingTransaction"
        ],
        "summary": "Download the MLS document of an incoming transaction.",
        "description": "Returns the MLS XML generated for the received document. Does not change the transaction status.",
        "operationId": "DownloadIncomingTransactionMls",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/in-transaction/by-status/{organizationId}": {
      "get": {
        "tags": [
          "IncomingTransaction"
        ],
        "summary": "Returns all transactions  for the organization by status.",
        "operationId": "ListIncomingTransactionsByStatus",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "Organization id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Requested transaction status",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.InTransactionStatus"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of records to return per page",
            "schema": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "description": "Opaque cursor token for the next page. Obtained from\n            the pagination.nextPageToken field of a previous response.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionListResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionListResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionListResult"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/in-transaction/from-date/{organizationId}": {
      "get": {
        "tags": [
          "IncomingTransaction"
        ],
        "summary": "Returns all transactions  for the organization from requested date and time.",
        "operationId": "ListIncomingTransactionsFromDate",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "Organization id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Requested date and time",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of records to return per page",
            "schema": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "description": "Opaque cursor token for the next page. Obtained from\n            the pagination.nextPageToken field of a previous response.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionListResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionListResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionListResult"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/in-transaction/not-downloaded/{organizationId}": {
      "get": {
        "tags": [
          "IncomingTransaction"
        ],
        "summary": "Returns all undownloaded transactions  for the organization.",
        "operationId": "ListIncomingTransactionsNotDownloaded",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "Organization id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of records to return per page",
            "schema": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "description": "Opaque cursor token for the next page. Obtained from\n            the pagination.nextPageToken field of a previous response.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionListResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionListResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionListResult"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/in-transaction/{transactionId}/attachment/{sequenceNumber}": {
      "get": {
        "tags": [
          "IncomingTransaction"
        ],
        "summary": "Get an attachment for an incoming transaction.",
        "description": "When the attachment is an external URL reference, a JSON object with the URL is returned.\nWhen the attachment is embedded binary content, it is extracted from the original invoice\nstored in the S3 inbox bucket and returned as a file download.",
        "operationId": "GetIncomingTransactionAttachment",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "sequenceNumber",
            "in": "path",
            "description": "Attachment sequence number.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organization/{id}": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Returns organization by ID for logged user.",
        "operationId": "GetOrganization",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organization id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Organization"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organization/logged-user": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Returns the organizations of the logged in user.",
        "operationId": "ListOrganizationsForLoggedUser",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OrganizationListResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organization/sml-lookup": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Looks up whether a PEPPOL participant is registered in the SML. Uses the MetadataLocator (SML/BDXL lookup).",
        "operationId": "UiSmlLookup",
        "parameters": [
          {
            "name": "peppolId",
            "in": "query",
            "description": "The PEPPOL identifier to look up (e.g. `9908:123456789`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.SmlLookupResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/out-transaction/{id}": {
      "get": {
        "tags": [
          "OutgoingTransaction"
        ],
        "summary": "Transaction ID",
        "operationId": "GetOutgoingTransaction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "events",
            "in": "query",
            "description": "Flag for requesting transaction events",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransaction"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransaction"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransaction"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "OutgoingTransaction"
        ],
        "summary": "Soft delete transaction",
        "operationId": "DeleteOutgoingTransaction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/out-transaction/by-state/{organizationId}": {
      "get": {
        "tags": [
          "OutgoingTransaction"
        ],
        "summary": "Returns all transactions  for the organization by status.",
        "operationId": "ListOutgoingTransactionsByStatus",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "Organization id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Requested transaction status. When omitted, all statuses are included.",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutTransactionStatus"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of records to return per page",
            "schema": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "description": "Opaque cursor token for the next page. Obtained from\n            the pagination.nextPageToken field of a previous response.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "Lower bound (inclusive) on the transaction creation date. Format: ISO 8601 (yyyy-MM-dd or yyyy-MM-ddTHH:mm:ss), time part is optional.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "Upper bound (inclusive) on the transaction creation date. Format: ISO 8601 (yyyy-MM-dd or yyyy-MM-ddTHH:mm:ss), time part is optional.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Include soft-deleted transactions in the results",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "Filter by tag value (exact match)",
            "schema": {
              "maxLength": 50,
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransactionListResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransactionListResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransactionListResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/out-transaction/download-doc/{id}": {
      "get": {
        "tags": [
          "OutgoingTransaction"
        ],
        "summary": "Download transaction document",
        "description": "Download document",
        "operationId": "DownloadOutgoingTransactionDoc",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "originalDoc",
            "in": "query",
            "description": "When `true`, downloads the originally received document instead of the document actually sent.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "sbd",
            "in": "header",
            "description": "Optional, default `true`. When `false`, returns only the inner\nbusiness document instead of the full StandardBusinessDocument.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/out-transaction/download-pdf/{id}": {
      "get": {
        "tags": [
          "OutgoingTransaction"
        ],
        "summary": "Download transaction document in PDF format.",
        "description": "Download document",
        "operationId": "DownloadOutgoingTransactionPdf",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "originalDoc",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/out-transaction/download-html/{id}": {
      "get": {
        "tags": [
          "OutgoingTransaction"
        ],
        "summary": "Download transaction document in HTML format.",
        "description": "Download document",
        "operationId": "DownloadOutgoingTransactionHtml",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "originalDoc",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/out-transaction/{transactionId}/attachment/{sequenceNumber}": {
      "get": {
        "tags": [
          "OutgoingTransaction"
        ],
        "summary": "Get an attachment for an outgoing transaction.",
        "description": "When the attachment is an external URL reference, a JSON object with the URL is returned.\nWhen the attachment is embedded binary content, it is extracted from the original invoice\nstored in the S3 outbox bucket and returned as a file download.",
        "operationId": "GetOutgoingTransactionAttachment",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "sequenceNumber",
            "in": "path",
            "description": "Attachment sequence number.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/out-transaction/download-rcp/{id}": {
      "get": {
        "tags": [
          "OutgoingTransaction"
        ],
        "summary": "Download transaction document recipient.",
        "operationId": "DownloadOutgoingTransactionRcp",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/out-transaction/download-mls/{id}": {
      "get": {
        "tags": [
          "OutgoingTransaction"
        ],
        "summary": "Download the MLS response document of an outgoing transaction.",
        "description": "Returns the MLS XML received for the sent document.",
        "operationId": "DownloadOutgoingTransactionMls",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/out-transaction/resend/{id}": {
      "put": {
        "tags": [
          "OutgoingTransaction"
        ],
        "summary": "Resend selected transaction",
        "operationId": "ResendOutgoingTransaction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/out-transaction/state-stats-by-tag/{organizationId}": {
      "get": {
        "tags": [
          "OutgoingTransaction"
        ],
        "summary": "Returns per-status transaction counts for the given organization and tag.",
        "operationId": "GetOutgoingTransactionStateStatsByTag",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "Organization id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "Tag value (exact match).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.Transaction.OutgoingTransactionTagStatsModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.Transaction.OutgoingTransactionTagStatsModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.Transaction.OutgoingTransactionTagStatsModel"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/out-transaction/tag/{organizationId}/{transactionId}": {
      "patch": {
        "tags": [
          "OutgoingTransaction"
        ],
        "summary": "Updates the tag of an outgoing transaction.",
        "operationId": "UpdateOutgoingTransactionTag",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "Organization id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "transactionId",
            "in": "path",
            "description": "Transaction id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "New tag value. Pass null or omit to clear.",
            "schema": {
              "maxLength": 50,
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sapi/v1/auth/token": {
      "post": {
        "tags": [
          "SapiAuth"
        ],
        "summary": "Obtain an access token using client credentials.",
        "description": "Authenticates a SAPI client by proxying the supplied credentials to the Keycloak identity provider.\nOnly the `client_credentials` grant type is supported.\nThe returned access token must be supplied as `Authorization: Bearer {access_token}` on all\nsubsequent SAPI requests. Tokens are short-lived (approximately 15 minutes).",
        "operationId": "SapiObtainToken",
        "requestBody": {
          "description": "Client credentials and grant type.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiTokenRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiTokenResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "423": {
            "description": "Locked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          }
        },
        "security": [ ]
      }
    },
    "/sapi/v1/auth/token/status": {
      "get": {
        "tags": [
          "SapiAuth"
        ],
        "summary": "Check the validity and metadata of the current access token.",
        "description": "Returns whether the supplied access token is active, along with its expiry and associated scopes.",
        "operationId": "SapiGetTokenStatus",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiTokenStatus"
                }
              }
            }
          }
        },
        "security": [ ]
      }
    },
    "/sapi/v1/auth/renew": {
      "post": {
        "tags": [
          "SapiAuth"
        ],
        "summary": "Renew an access token using a refresh token.",
        "description": "Exchanges a previously issued refresh token for a new access token (and optionally a new refresh token)\nwithout requiring the client to re-supply its credentials.\nThe renewal request is forwarded to the configured Keycloak identity provider.",
        "operationId": "SapiRenewToken",
        "requestBody": {
          "description": "Refresh token to exchange.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiRenewRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiTokenResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          }
        },
        "security": [ ]
      }
    },
    "/sapi/v1/auth/revoke": {
      "post": {
        "tags": [
          "SapiAuth"
        ],
        "summary": "Revoke an access or refresh token.",
        "description": "Immediately invalidates the supplied token so it cannot be used for further authentication.",
        "operationId": "SapiRevokeToken",
        "requestBody": {
          "description": "Token revocation request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiRevokeRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiRevokeResponse"
                }
              }
            }
          }
        },
        "security": [ ]
      }
    },
    "/sapi/v1/document/send": {
      "post": {
        "tags": [
          "SapiDocument"
        ],
        "summary": "Submit a document for Peppol delivery",
        "description": "Submit a single electronic business document for processing and delivery via Peppol network.\nVersion 1.0 keeps its original contract (200 OK); version 2.0 answers 202 Accepted per SAPI-SK v1.0 section 7.2.",
        "operationId": "SapiSendDocument",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key for idempotent document submission. Same key + same payload returns the original response. Same key + different payload returns 409 Conflict. Keys expire after 24 hours.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          {
            "name": "X-Peppol-Participant-Id",
            "in": "header",
            "description": "Sender's Peppol Participant ID (organization context). Must match metadata.senderParticipantId in the request body.",
            "schema": {
              "type": "string"
            },
            "example": "0245:1234567890"
          }
        ],
        "requestBody": {
          "description": "Document send request containing metadata and payload.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiSendDocumentRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "Document accepted for processing. The returned `providerDocumentId` is the transaction ID that can be used in the `api/v1/out-transaction` endpoints.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiSendDocumentResponse"
                }
              }
            }
          },
          "403": {
            "description": "Authorization error (no org access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict - Idempotency-Key has already been used with a different request payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ]
      }
    },
    "/sapi/v1/document/receive": {
      "get": {
        "tags": [
          "SapiDocument"
        ],
        "summary": "List received documents.",
        "description": "Retrieve a cursor-paginated list of documents received via Peppol network for your organization.\nDocuments are returned in ascending order by received date (oldest first) per SAPI specification.\nUse pageToken for cursor-based pagination. This operation does not imply acknowledgement or state transition.",
        "operationId": "SapiListReceivedDocuments",
        "parameters": [
          {
            "name": "X-Peppol-Participant-Id",
            "in": "header",
            "description": "Receiver's Peppol Participant ID (organization context).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "description": "Opaque cursor token for the next page. Obtained from the nextPageToken field of a previous response.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of records to return per page (1-100, default 20).",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer",
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by document status. Use RECEIVED for documents awaiting acknowledgement, or ACKNOWLEDGED for confirmed documents.",
            "schema": {
              "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiDocumentStatus"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiReceivedDocumentListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ]
      }
    },
    "/sapi/v1/document/receive/{documentId}": {
      "get": {
        "tags": [
          "SapiDocument"
        ],
        "summary": "Retrieve the full content of a specific inbound document.",
        "description": "Returns the document metadata and its base64-encoded content.\nClients should acknowledge the document after successful processing.",
        "operationId": "SapiGetReceivedDocument",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "description": "Unique SAPI document identifier returned by `GET /document/receive`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Peppol-Participant-Id",
            "in": "header",
            "description": "Receiver's Peppol Participant ID (organization context).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payloadFormat",
            "in": "header",
            "description": "Optional payload encoding: \"XML\" (default) or \"Base64\", case-insensitive. \"XML\" returns the\ndocument as raw XML text; \"Base64\" returns the full StandardBusinessDocument, base64-encoded.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sbd",
            "in": "header",
            "description": "Optional. When `true`, returns the full StandardBusinessDocument instead of just the inner\nbusiness document. Has no effect when payloadFormat is \"Base64\".",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiReceivedDocumentDetailResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ]
      }
    },
    "/sapi/v1/document/receive/{documentId}/acknowledge": {
      "post": {
        "tags": [
          "SapiDocument"
        ],
        "summary": "Acknowledge receipt and processing of an inbound document.",
        "description": "Confirms that the client has successfully retrieved and processed the document.\nAcknowledged documents are marked with ACKNOWLEDGED status and will no longer appear\nin subsequent `GET /document/receive` responses when filtering by RECEIVED status.",
        "operationId": "SapiAcknowledgeDocument",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "description": "Unique SAPI document identifier to acknowledge.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Peppol-Participant-Id",
            "in": "header",
            "description": "Receiver's Peppol Participant ID (organization context).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiAcknowledgeResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ]
      }
    },
    "/api/v1/webhook/register": {
      "post": {
        "tags": [
          "WebhookRegister"
        ],
        "summary": "Creates or updates the webhook for the current user within the given organization.",
        "operationId": "RegisterWebhook",
        "requestBody": {
          "description": "Organization, target URL (must be HTTPS), and optional API key.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.WebhookRegisterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.WebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhook/register/{organizationId}": {
      "get": {
        "tags": [
          "WebhookRegister"
        ],
        "summary": "Returns the webhook status for the current user within the given organization.",
        "operationId": "GetWebhook",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "Organization identifier.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.WebhookResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "WebhookRegister"
        ],
        "summary": "Deletes the webhook for the current user within the given organization.",
        "operationId": "DeleteWebhook",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "Organization identifier.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhook/schema": {
      "get": {
        "tags": [
          "WebhookRegister"
        ],
        "summary": "Returns documentation for the outbound webhook call: HTTP method, headers, and example\npayloads for both the FAILED and REJECTED cases. Public/unauthenticated so integrators\ncan inspect the contract without first registering a webhook or triggering a real failure.",
        "operationId": "GetWebhookPayloadSchema",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.WebhookPayloadDocumentation"
                }
              }
            }
          }
        },
        "security": [ ]
      }
    }
  },
  "components": {
    "schemas": {
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Address": {
        "required": [
          "city",
          "countryCode",
          "postalCode"
        ],
        "type": "object",
        "properties": {
          "streetName": {
            "maxLength": 100,
            "type": "string",
            "description": "The name of the street or road.",
            "nullable": true,
            "example": "Horná"
          },
          "streetNumber": {
            "maxLength": 20,
            "type": "string",
            "description": "he number of the building or property",
            "nullable": true,
            "example": "1478/25"
          },
          "city": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string",
            "description": "The city, town, or locality where the recipient is located.",
            "example": "Bratislava"
          },
          "postalCode": {
            "maxLength": 12,
            "minLength": 1,
            "type": "string",
            "description": "A numeric or alphanumeric code that helps identify the specific area for mail\ndelivery.",
            "example": "84103"
          },
          "countryCode": {
            "maxLength": 2,
            "minLength": 1,
            "type": "string",
            "description": "Country code.",
            "example": "SK"
          }
        },
        "additionalProperties": false,
        "description": "Address"
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.DocumentSendJsonRequest": {
        "required": [
          "file"
        ],
        "type": "object",
        "properties": {
          "file": {
            "minLength": 1,
            "type": "string",
            "description": "The XML document as text. Must be UTF-8: the XML prolog must not declare any other encoding.\nMaximum size: 10 MB."
          },
          "skipValidation": {
            "type": "boolean",
            "description": "When true, XSD, UBL, and Schematron validation are skipped on ingestion.\nThe document will be fully validated before it is sent by the background processing pipeline.",
            "nullable": true
          },
          "tag": {
            "maxLength": 50,
            "type": "string",
            "description": "A custom tag attached to a document submission transaction.\nThe tag can be used to later search for a transaction or view statistics on the results of document submissions with the same tag.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Send document request with the XML document carried as a plain (JSON-escaped) string in a JSON body.",
        "example": {
          "file": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"\n</Invoice>",
          "skipValidation": true,
          "tag": "october-2026-batch"
        }
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.DocumentSendResponse": {
        "required": [
          "checksum",
          "status",
          "transactionId"
        ],
        "type": "object",
        "properties": {
          "transactionId": {
            "minLength": 1,
            "type": "string",
            "description": "Transaction id."
          },
          "status": {
            "minLength": 1,
            "type": "string",
            "description": "Status"
          },
          "checksum": {
            "minLength": 1,
            "type": "string",
            "description": "Checksum calculated from the input business document (xml)."
          }
        },
        "additionalProperties": false,
        "description": "Send document response"
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.DocumentValidateResponse": {
        "type": "object",
        "properties": {
          "isValid": {
            "type": "boolean",
            "description": "Indicates whether the document passed all validation stages without any error-severity issues."
          },
          "documentType": {
            "type": "string",
            "description": "Detected document type (e.g., \"Invoice\", \"CreditNote\").\nNull when the type could not be determined.",
            "nullable": true
          },
          "checksum": {
            "type": "string",
            "description": "SHA-256 checksum of the uploaded file encoded as Base64.",
            "nullable": true
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.DocumentValidationIssue"
            },
            "description": "All validation issues collected across every validation stage.\nAn empty list combined with ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.DocumentValidateResponse.IsValid == true means the document is fully valid."
          }
        },
        "additionalProperties": false,
        "description": "Response returned by the document validate endpoint.\nContains overall validity status, detected document type, checksum, and a flat\nlist of all issues collected across every validation stage."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.DocumentValidationIssue": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string",
            "description": "Validation stage that produced this issue.\nPossible values: \"SBDH_XSD\", \"DOCUMENT_TYPE\", \"UBL\", \"SCHEMATRON\"."
          },
          "severity": {
            "type": "string",
            "description": "Severity of the issue. Possible values: \"error\", \"warning\"."
          },
          "message": {
            "type": "string",
            "description": "Human-readable description of the validation failure."
          },
          "location": {
            "type": "string",
            "description": "XPath location within the document where the issue was detected.\nPopulated for Schematron issues; null for XSD and structural issues.",
            "nullable": true
          },
          "lineNumber": {
            "type": "integer",
            "description": "Line number in the XML source where the issue was detected.\nPopulated for XSD issues; null for Schematron issues.",
            "format": "int32",
            "nullable": true
          },
          "linePosition": {
            "type": "integer",
            "description": "Character position on the line where the issue was detected.\nPopulated for XSD issues; null for Schematron issues.",
            "format": "int32",
            "nullable": true
          },
          "errorId": {
            "type": "string",
            "description": "Rule identifier that failed, e.g. \"PEPPOL-EN16931-R010\".\nPopulated for Schematron issues; null for XSD and structural issues.",
            "nullable": true
          },
          "artifactPath": {
            "type": "string",
            "description": "Path of the validation artifact (XSD or XSLT) that produced this issue.\nPopulated for Schematron issues; null for structural issues.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A single validation issue reported by one of the validation stages."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.GeneralIdentifier": {
        "required": [
          "id",
          "identifier",
          "scheme"
        ],
        "type": "object",
        "properties": {
          "id": {
            "minLength": 1,
            "type": "string",
            "description": "schemeID"
          },
          "scheme": {
            "minLength": 1,
            "type": "string",
            "description": "Scheme used"
          },
          "identifier": {
            "minLength": 1,
            "type": "string",
            "description": "An organization identifier, such as 0106:0987654321"
          }
        },
        "additionalProperties": false,
        "description": "Not implemented."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.InTransactionStatus": {
        "enum": [
          "ACKNOWLEDGED",
          "DOWNLOADED",
          "NEW",
          "READ"
        ],
        "type": "string",
        "description": "Incomming transaction status."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransaction": {
        "required": [
          "id",
          "receivedAt",
          "senderId",
          "senderName",
          "state"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Id transaction",
            "format": "int64",
            "example": 12345
          },
          "state": {
            "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.InTransactionStatus"
          },
          "receivedAt": {
            "type": "string",
            "description": "Created at.",
            "format": "date-time"
          },
          "readAt": {
            "type": "string",
            "description": "Read at.",
            "format": "date-time",
            "nullable": true
          },
          "senderName": {
            "minLength": 1,
            "type": "string",
            "description": "Sender name"
          },
          "senderId": {
            "minLength": 1,
            "type": "string",
            "description": "Sender peppol id."
          },
          "documentNumber": {
            "type": "string",
            "description": "Document number.",
            "nullable": true
          },
          "documentTypeIdentifier": {
            "type": "string",
            "description": "Document Type Identifier (DTI) BIS 3.0",
            "nullable": true
          },
          "transmissionId": {
            "type": "string",
            "description": "TransmissionIdentifier",
            "nullable": true
          },
          "documentTypeCode": {
            "type": "string",
            "description": "Gets or sets the code that identifies the type of document.",
            "nullable": true
          },
          "documentTypeId": {
            "type": "string",
            "description": "Document type ID of the received document.",
            "nullable": true
          },
          "processId": {
            "type": "string",
            "description": "Process ID of the received document.",
            "nullable": true
          },
          "attachmentCount": {
            "type": "integer",
            "description": "Number of attachments associated with the transaction.",
            "format": "int32",
            "nullable": true
          },
          "deleted": {
            "type": "boolean",
            "description": "Indicates whether the transaction is soft-deleted."
          },
          "mlsExists": {
            "type": "boolean",
            "description": "Indicates whether an MLS document for this transaction is available for download.\nPopulated on detail endpoint; false in list results."
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionAttachment"
            },
            "description": "Attachments associated with the transaction.\nPopulated on detail endpoint.",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionEvent"
            },
            "description": "Incoming transaction events associated with the transaction.\nPopulated only when requested via the events query parameter.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionAttachment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier of the attachment record.",
            "format": "int64"
          },
          "sequenceNumber": {
            "type": "integer",
            "description": "Sequence number of the corresponding AdditionalDocumentReference element.",
            "format": "int32"
          },
          "documentTypeCode": {
            "type": "string",
            "description": "Document type code from AdditionalDocumentReference/DocumentTypeCode.",
            "nullable": true
          },
          "documentDescription": {
            "type": "string",
            "description": "Human-readable description from AdditionalDocumentReference/DocumentDescription.",
            "nullable": true
          },
          "externalReference": {
            "type": "string",
            "description": "External URI when the attachment is a URL reference.",
            "nullable": true
          },
          "hasEmbeddedDocument": {
            "type": "boolean",
            "description": "True when the attachment contains embedded binary content."
          },
          "embeddedDocumentMimeCode": {
            "type": "string",
            "description": "MIME type of the embedded document.",
            "nullable": true
          },
          "embeddedDocumentFilename": {
            "type": "string",
            "description": "Suggested filename for the embedded document.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Metadata of a single attachment associated with an incoming transaction.\nBinary content is not included."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionEvent": {
        "required": [
          "id",
          "incomingTransactionEventType",
          "incomingTransactionId",
          "occurredAt",
          "severity"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Internal identifier of the event.",
            "format": "int64"
          },
          "occurredAt": {
            "type": "string",
            "description": "Event timestamp.",
            "format": "date-time"
          },
          "incomingTransactionId": {
            "type": "integer",
            "description": "Incoming transaction identifier the event belongs to.",
            "format": "int64"
          },
          "incomingTransactionEventType": {
            "minLength": 1,
            "type": "string",
            "description": "Incoming transaction event type code."
          },
          "additionalInfo": {
            "type": "string",
            "description": "Additional information for the event.",
            "nullable": true
          },
          "severity": {
            "type": "string",
            "description": "Event severity."
          }
        },
        "additionalProperties": false
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransactionListResult": {
        "required": [
          "nextPageToken",
          "transactions"
        ],
        "type": "object",
        "properties": {
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.IncomingTransaction"
            }
          },
          "nextPageToken": {
            "minLength": 1,
            "type": "string",
            "description": "Opaque cursor token for the next page. Pass as pageToken in request header to\nfetch the next page. Absent when no more pages."
          }
        },
        "additionalProperties": false,
        "description": "List of incoming transactions"
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Organization": {
        "required": [
          "address",
          "email",
          "ico",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier (empty in new Organization)",
            "format": "int64",
            "nullable": true
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string",
            "description": "Organization name",
            "example": "MyCompany"
          },
          "ico": {
            "maxLength": 10,
            "minLength": 1,
            "type": "string",
            "description": "Indetification number",
            "example": "12345678"
          },
          "dic": {
            "maxLength": 10,
            "type": "string",
            "description": "Tax identification number.",
            "nullable": true,
            "example": "1234567890"
          },
          "icDph": {
            "maxLength": 15,
            "type": "string",
            "description": "VAT identification number (IC DPH).",
            "nullable": true,
            "example": "SK1234567890"
          },
          "peppolId": {
            "maxLength": 20,
            "type": "string",
            "description": "Peppol identifier.",
            "nullable": true
          },
          "email": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string",
            "description": "Communication email address (for registration)",
            "example": "mycompany@mycompany.sk"
          },
          "phone": {
            "maxLength": 100,
            "type": "string",
            "description": "Communication phone number (for registration)",
            "nullable": true
          },
          "identifier": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.GeneralIdentifier"
            },
            "description": "Other identifiers, no implemented."
          },
          "address": {
            "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Address"
          }
        },
        "additionalProperties": false,
        "description": "Organization"
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OrganizationListResult": {
        "required": [
          "nextPageToken",
          "organizations"
        ],
        "type": "object",
        "properties": {
          "organizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Organization"
            }
          },
          "nextPageToken": {
            "minLength": 1,
            "type": "string",
            "description": "Opaque cursor token for the next page. Pass as pageToken in request header to\nfetch the next page. Absent when no more pages."
          }
        },
        "additionalProperties": false,
        "description": "List of organizations"
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutTransactionStatus": {
        "enum": [
          "DELIVERED",
          "FAILED",
          "NEW",
          "PREPARING",
          "REJECTED",
          "SENT",
          "TEMPORARY_FAILURE",
          "SENT_WITHOUT_RESPONSE"
        ],
        "type": "string",
        "description": "Outgoing transaction status."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransaction": {
        "required": [
          "createdAt",
          "createdBy",
          "id",
          "receiverId",
          "receiverName",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Id transaction",
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutTransactionStatus"
          },
          "createdAt": {
            "type": "string",
            "description": "Created at.",
            "format": "date-time"
          },
          "createdBy": {
            "type": "integer",
            "description": "User identification who created the transaction.",
            "format": "int64"
          },
          "receiverId": {
            "minLength": 1,
            "type": "string",
            "description": "Receiver peppol id."
          },
          "receiverName": {
            "minLength": 1,
            "type": "string",
            "description": "Receiver name"
          },
          "transmissionId": {
            "type": "string",
            "description": "TransmissionIdentifier",
            "nullable": true
          },
          "documentNumber": {
            "type": "string",
            "description": "Document number.",
            "nullable": true
          },
          "documentTypeIdentifier": {
            "type": "string",
            "description": "Document Type Identifier (DTI) BIS 3.0",
            "nullable": true
          },
          "documentTypeCode": {
            "type": "string",
            "description": "Gets or sets the code that identifies the type of document.",
            "nullable": true
          },
          "documentProfileId": {
            "type": "string",
            "description": "Document Profile Identifier (BIS 3.0 process ID).",
            "nullable": true
          },
          "originalDocumentHash": {
            "type": "string",
            "description": "SHA-256 hash of the original uploaded document.",
            "nullable": true
          },
          "lastSentAt": {
            "type": "string",
            "description": "Last sent at.",
            "format": "date-time",
            "nullable": true
          },
          "attachmentCount": {
            "type": "integer",
            "description": "Number of attachments associated with the transaction.",
            "format": "int32",
            "nullable": true
          },
          "deleted": {
            "type": "boolean",
            "description": "Indicates whether the transaction is soft-deleted."
          },
          "tag": {
            "type": "string",
            "description": "Optional tag for categorizing the transaction.",
            "nullable": true
          },
          "mlsExists": {
            "type": "boolean",
            "description": "Indicates whether an MLS response document is available for download."
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransactionAttachment"
            },
            "description": "Attachments associated with the transaction.\nPopulated on detail endpoint.",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransactionEvent"
            },
            "description": "Outgoing transaction events associated with the transaction.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransactionAttachment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier of the attachment record.",
            "format": "int64"
          },
          "sequenceNumber": {
            "type": "integer",
            "description": "Sequence number of the corresponding AdditionalDocumentReference element.",
            "format": "int32"
          },
          "documentTypeCode": {
            "type": "string",
            "description": "Document type code from AdditionalDocumentReference/DocumentTypeCode.",
            "nullable": true
          },
          "documentDescription": {
            "type": "string",
            "description": "Human-readable description from AdditionalDocumentReference/DocumentDescription.",
            "nullable": true
          },
          "externalReference": {
            "type": "string",
            "description": "External URI when the attachment is a URL reference.",
            "nullable": true
          },
          "hasEmbeddedDocument": {
            "type": "boolean",
            "description": "True when the attachment contains embedded binary content."
          },
          "embeddedDocumentMimeCode": {
            "type": "string",
            "description": "MIME type of the embedded document.",
            "nullable": true
          },
          "embeddedDocumentFilename": {
            "type": "string",
            "description": "Suggested filename for the embedded document.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Metadata of a single attachment associated with an outgoing transaction.\nBinary content is not included."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransactionEvent": {
        "required": [
          "id",
          "occurredAt",
          "outgoingTransactionEventType",
          "outgoingTransactionId",
          "severity"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Internal identifier of the event.",
            "format": "int64"
          },
          "occurredAt": {
            "type": "string",
            "description": "Event timestamp.",
            "format": "date-time"
          },
          "outgoingTransactionId": {
            "type": "integer",
            "description": "Outgoing transaction identifier the event belongs to.",
            "format": "int64"
          },
          "outgoingTransactionEventType": {
            "minLength": 1,
            "type": "string",
            "description": "Outgoing transaction event type code."
          },
          "additionalInfo": {
            "type": "string",
            "description": "Additional information for the event.",
            "nullable": true
          },
          "severity": {
            "type": "string",
            "description": "Event severity."
          }
        },
        "additionalProperties": false
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransactionListResult": {
        "required": [
          "nextPageToken",
          "transactions"
        ],
        "type": "object",
        "properties": {
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.OutgoingTransaction"
            }
          },
          "nextPageToken": {
            "minLength": 1,
            "type": "string",
            "description": "Opaque cursor token for the next page. Pass as pageToken in request header to\nfetch the next page. Absent when no more pages."
          }
        },
        "additionalProperties": false,
        "description": "List of outgoing transactions"
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiAcknowledgeResponse": {
        "type": "object",
        "properties": {
          "documentId": {
            "type": "string",
            "description": "The acknowledged document identifier."
          },
          "status": {
            "type": "string",
            "description": "Acknowledgement status (always \"ACKNOWLEDGED\")."
          },
          "acknowledgedDateTime": {
            "type": "string",
            "description": "Timestamp when the document was acknowledged.",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Response returned by the SAPI `POST /document/receive/{documentId}/acknowledge` endpoint.\nConfirms that a received document has been successfully acknowledged by the client."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiDocumentMetadata": {
        "required": [
          "creationDateTime",
          "documentId",
          "documentTypeId",
          "processId",
          "receiverParticipantId",
          "senderParticipantId"
        ],
        "type": "object",
        "properties": {
          "documentId": {
            "minLength": 1,
            "type": "string",
            "description": "Client-assigned unique document identifier.",
            "example": "INV-2026-0001"
          },
          "documentTypeId": {
            "minLength": 1,
            "type": "string",
            "description": "Peppol Document Type Identifier.",
            "example": "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1"
          },
          "processId": {
            "minLength": 1,
            "type": "string",
            "description": "Peppol Process Identifier.",
            "example": "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0"
          },
          "senderParticipantId": {
            "minLength": 1,
            "type": "string",
            "description": "Sender's Peppol Participant ID.",
            "example": "0245:1234567890"
          },
          "receiverParticipantId": {
            "minLength": 1,
            "type": "string",
            "description": "Receiver's Peppol Participant ID.",
            "example": "0245:9876543210"
          },
          "creationDateTime": {
            "type": "string",
            "description": "Document creation timestamp in ISO 8601 format.",
            "format": "date-time",
            "example": "2026-02-12T10:30:00Z"
          }
        },
        "additionalProperties": false,
        "description": "Metadata describing a SAPI document (inbound or outbound) per SAPI v1.0 specification.\nUsed in both send requests and receive responses."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiDocumentStatus": {
        "enum": [
          "RECEIVED",
          "ACKNOWLEDGED"
        ],
        "type": "string",
        "description": "SAPI document status values for filtering received documents.\nUsed in GET /document/receive endpoint to filter documents by their processing state."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiError": {
        "required": [
          "category",
          "code",
          "correlation_id",
          "message",
          "retryable"
        ],
        "type": "object",
        "properties": {
          "category": {
            "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorCategory"
          },
          "code": {
            "minLength": 1,
            "type": "string",
            "description": "Machine-readable error code that uniquely identifies the error type within its category\n(e.g., \"invalid_client\", \"document_not_found\")."
          },
          "message": {
            "minLength": 1,
            "type": "string",
            "description": "Human-readable description of the error suitable for logging and diagnostics."
          },
          "details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorDetail"
            },
            "description": "Optional field-level or contextual information to aid diagnostics.\nEach entry describes a specific field that caused the error.",
            "nullable": true
          },
          "retryable": {
            "type": "boolean",
            "description": "Indicates whether the client may retry the request. True for TEMPORARY category errors;\nfalse for all other categories where retry would not change the outcome."
          },
          "correlation_id": {
            "minLength": 1,
            "type": "string",
            "description": "Correlation identifier that links this error to the originating request in server-side logs.\nClients should include this value when reporting issues for support."
          }
        },
        "additionalProperties": false,
        "description": "Represents a single structured error returned by the SAPI interface."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorCategory": {
        "enum": [
          "AUTH",
          "VALIDATION",
          "PROCESSING",
          "TEMPORARY",
          "PERMANENT"
        ],
        "type": "string",
        "description": "Categorizes the type of error returned by the SAPI interface.\nMaps directly to the SAPI protocol error category enum values."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorDetail": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "description": "The field that caused the error.",
            "nullable": true
          },
          "issue": {
            "type": "string",
            "description": "Description of the issue with the field.",
            "nullable": true
          },
          "value": {
            "type": "string",
            "description": "The invalid value that was provided.",
            "nullable": true
          },
          "errorId": {
            "type": "string",
            "description": "PEPPOL rule identifier that failed, e.g. \"PEPPOL-EN16931-R010\".\nPopulated for Schematron validation errors; null otherwise.",
            "nullable": true
          },
          "artifactPath": {
            "type": "string",
            "description": "Path of the validation artifact (XSD or XSLT) that produced this error.\nPopulated for Schematron validation errors; null otherwise.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Field-level error detail within a ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiError."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiErrorResponse": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiError"
          }
        },
        "additionalProperties": false,
        "description": "Top-level error envelope returned by all SAPI endpoints when a request fails.\nAll non-2xx responses from SAPI endpoints use this structure."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiReceivedDocumentDetailResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiDocumentMetadata"
          },
          "payload": {
            "type": "string",
            "description": "The document content. With the default \"XML\" payloadFormat, this is the raw XML of the inner\nbusiness document (or the full StandardBusinessDocument when the `sbd` header is true).\nWith payloadFormat \"Base64\", this is the full StandardBusinessDocument, base64-encoded."
          },
          "payloadFormat": {
            "type": "string",
            "description": "Format of the payload content: \"XML\" (default) or \"Base64\"."
          }
        },
        "additionalProperties": false,
        "description": "Response returned by the SAPI `GET /document/receive/{documentId}` endpoint per SAPI v1.0 section 8.2.\nContains the full metadata and content of a single inbound document.\nBy default, ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiReceivedDocumentDetailResponse.Payload contains only the inner business document (as identified by\n`metadata.documentTypeId`), extracted from its StandardBusinessDocument envelope. Controlled by the\noptional `payloadFormat` and `sbd` request headers."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiReceivedDocumentListResponse": {
        "type": "object",
        "properties": {
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiDocumentMetadata"
            },
            "description": "List of document metadata (sorted oldest first)."
          },
          "nextPageToken": {
            "type": "string",
            "description": "Opaque cursor token for the next page. Pass as ?pageToken= to fetch the next page. Absent when no more pages.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Response returned by the SAPI `GET /document/receive` endpoint per SAPI v1.0 section 8.1.\nContains a cursor-paginated list of documents received via Peppol network.\nListing does not imply retrieval, processing, or business acceptance."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiRenewRequest": {
        "required": [
          "refresh_token"
        ],
        "type": "object",
        "properties": {
          "refresh_token": {
            "minLength": 1,
            "type": "string",
            "description": "Refresh token previously issued by `POST /auth/token` or a prior `POST /auth/renew` call.\nThe token is validated against the configured Keycloak identity provider."
          }
        },
        "additionalProperties": false,
        "description": "Request body for the SAPI `POST /auth/renew` endpoint.\nExchanges a valid refresh token for a new access (and optionally refresh) token."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiRevokeRequest": {
        "required": [
          "token"
        ],
        "type": "object",
        "properties": {
          "token": {
            "minLength": 1,
            "type": "string",
            "description": "The token string to be revoked."
          },
          "token_type_hint": {
            "type": "string",
            "description": "Optional hint about the type of token being revoked.\nThe only accepted value per the SAPI spec is `refresh_token`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Request body for the SAPI `POST /auth/revoke` endpoint.\nRequests invalidation of a previously issued access or refresh token."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiRevokeResponse": {
        "required": [
          "success"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Indicates whether the token was successfully revoked."
          },
          "message": {
            "type": "string",
            "description": "Human-readable confirmation message.",
            "nullable": true
          },
          "timestamp": {
            "type": "string",
            "description": "Timestamp of the revocation in ISO 8601 format.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Response returned by the SAPI `POST /auth/revoke` endpoint on successful token revocation."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiSendDocumentRequest": {
        "required": [
          "metadata",
          "payload",
          "payloadFormat"
        ],
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiDocumentMetadata"
          },
          "payload": {
            "minLength": 1,
            "type": "string",
            "description": "Peppol-conformant business document content (UTF-8 encoded UBL XML). Maximum size: 10 MB.",
            "example": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"><cbc:ID>INV-2026-0001</cbc:ID></Invoice>"
          },
          "payloadFormat": {
            "minLength": 1,
            "enum": [
              "XML"
            ],
            "type": "string",
            "description": "Format of the payload. Fixed to XML in SAPI v1.0.",
            "example": "XML"
          },
          "payloadEncoding": {
            "type": "string",
            "description": "Optional character encoding of the payload. Defaults to UTF-8.",
            "nullable": true,
            "example": "UTF-8"
          },
          "checksum": {
            "pattern": "^[a-f0-9]{64}$",
            "type": "string",
            "description": "Optional integrity checksum. If provided, MUST be SHA-256 calculated over the exact byte representation\nof the payload before transmission, encoded as lowercase hexadecimal (64 characters).",
            "nullable": true,
            "example": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
          }
        },
        "additionalProperties": false,
        "description": "SAPI v1.0 document submission payload (per section 7.1)."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiSendDocumentResponse": {
        "required": [
          "providerDocumentId",
          "status",
          "timestamp"
        ],
        "type": "object",
        "properties": {
          "providerDocumentId": {
            "minLength": 1,
            "type": "string",
            "description": "Unique document identifier assigned by the Access Point provider.\nIt is the transaction ID that can be used in the `api/v1/out-transaction` endpoints.",
            "example": "123456"
          },
          "status": {
            "minLength": 1,
            "enum": [
              "ACCEPTED",
              "REJECTED"
            ],
            "type": "string",
            "description": "ACCEPTED = technical receipt confirmed. REJECTED = document was not accepted.",
            "example": "ACCEPTED"
          },
          "receivedAt": {
            "type": "string",
            "description": "Timestamp when the document was received. Required when status = ACCEPTED.",
            "format": "date-time",
            "nullable": true
          },
          "timestamp": {
            "type": "string",
            "description": "Response generation timestamp",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Send Document response (per section 7.2). Synchronous acceptance confirms technical receipt only.\nIt does not imply semantic validation, successful Peppol delivery, or legal effect."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiTokenRequest": {
        "required": [
          "client_id",
          "client_secret",
          "grant_type"
        ],
        "type": "object",
        "properties": {
          "client_id": {
            "minLength": 1,
            "type": "string",
            "description": "Client identifier issued during SAPI registration.\nCorresponds to the Keycloak client_id used for authentication."
          },
          "client_secret": {
            "minLength": 1,
            "type": "string",
            "description": "Client secret issued during SAPI registration.\nCorresponds to the Keycloak client_secret used for authentication."
          },
          "grant_type": {
            "minLength": 1,
            "type": "string",
            "description": "OAuth 2.0 grant type. Must be `client_credentials`.\nOther grant types are not supported by the SAPI protocol.",
            "example": "client_credentials"
          },
          "scope": {
            "type": "string",
            "description": "Optional space-delimited list of requested OAuth 2.0 scopes.\nWhen omitted, the default scopes configured for the client in Keycloak are granted.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Request body for the SAPI `POST /auth/token` endpoint.\nThe SAPI protocol supports the `client_credentials` grant type only.\nCredentials are validated by proxying to the configured Keycloak identity provider."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiTokenResponse": {
        "required": [
          "access_token",
          "expires_in",
          "token_type"
        ],
        "type": "object",
        "properties": {
          "access_token": {
            "minLength": 1,
            "type": "string",
            "description": "JWT access token to be included in the `Authorization: Bearer` header of subsequent SAPI requests.\nTokens are short-lived (typically 15 minutes as per the SAPI specification)."
          },
          "token_type": {
            "minLength": 1,
            "type": "string",
            "description": "Token type. Always `Bearer` for the SAPI protocol.",
            "example": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "description": "Access token lifetime in seconds from the time of issuance.\nClients should use this value to schedule proactive token renewal before expiry.",
            "format": "int32",
            "example": 900
          },
          "scope": {
            "type": "string",
            "description": "Space-delimited list of scopes granted with this token.\nMay be absent when the granted scope matches the requested scope.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Response returned by the SAPI `POST /auth/token` and `POST /auth/renew` endpoints\nupon successful authentication or token renewal."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.Sapi.SapiTokenStatus": {
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean",
            "description": "Whether the token is currently valid."
          },
          "token_type": {
            "type": "string",
            "description": "Token type. Always `access` for access tokens.",
            "nullable": true
          },
          "client_id": {
            "type": "string",
            "description": "The client ID this token belongs to (`azp` claim).",
            "nullable": true
          },
          "issued_at": {
            "type": "string",
            "description": "When the token was issued (`iat` claim), ISO 8601.",
            "nullable": true
          },
          "expires_at": {
            "type": "string",
            "description": "When the token will expire (`exp` claim), ISO 8601.",
            "nullable": true
          },
          "expires_in_seconds": {
            "type": "integer",
            "description": "Seconds remaining until expiration.",
            "format": "int32",
            "nullable": true
          },
          "should_refresh": {
            "type": "boolean",
            "description": "True if the token should be refreshed soon (less than 3 minutes remaining).",
            "nullable": true
          },
          "refresh_recommended_at": {
            "type": "string",
            "description": "Recommended time to refresh the token, ISO 8601.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Response returned by the SAPI `GET /auth/token/status` endpoint.\nIndicates the current validity state and metadata of the supplied access token."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.SmlLookupResult": {
        "type": "object",
        "properties": {
          "Registered": {
            "type": "boolean",
            "description": "Indicates whether the participant is registered in the SML network."
          },
          "PeppolId": {
            "type": "string",
            "description": "The PEPPOL identifier that was looked up.",
            "nullable": true
          },
          "EndpointUrl": {
            "type": "string",
            "description": "Metadata URL,\nnull when the participant is not registered.",
            "nullable": true
          },
          "ErrorMessage": {
            "type": "string",
            "description": "Human-readable error message when ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.SmlLookupResult.Registered is false.\nnull on success.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.WebhookPayloadDocumentation": {
        "type": "object",
        "properties": {
          "httpMethod": {
            "type": "string",
            "description": "HTTP method used for the webhook call."
          },
          "contentType": {
            "type": "string",
            "description": "Content type of the request body."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "HTTP headers sent with the request, and when each is present."
          },
          "description": {
            "type": "string",
            "description": "Human-readable description of when and how the webhook is called."
          },
          "exampleFailed": {
            "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.WebhookDispatchPayload"
          },
          "exampleRejected": {
            "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.WebhookDispatchPayload"
          }
        },
        "additionalProperties": false,
        "description": "Documents the exact shape of the HTTP call ePoštár makes to a registered webhook URL.\nReturned by `GET /api/v1/webhook/schema` so integrators can build a receiving endpoint\nwithout needing to trigger a real FAILED/REJECTED transaction first."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.WebhookRegisterRequest": {
        "required": [
          "organizationId",
          "url"
        ],
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "integer",
            "description": "Organization the webhook belongs to.",
            "format": "int64"
          },
          "apiKey": {
            "maxLength": 500,
            "type": "string",
            "description": "Optional API key sent to the target URL when the webhook is called.",
            "nullable": true
          },
          "url": {
            "maxLength": 2048,
            "minLength": 1,
            "type": "string",
            "description": "Target address the webhook is called on. Must use HTTPS (any port is allowed) and must be a public\ninternet address: localhost, private/link-local IP ranges, internal host names and URLs with\nembedded credentials are rejected.",
            "format": "uri"
          }
        },
        "additionalProperties": false,
        "description": "Request to create or update the webhook for the current user within an organization."
      },
      "ElektronickyPostar.PublicAPI.Models.Customs.Api.V1.WebhookResponse": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "integer",
            "description": "Organization the webhook belongs to.",
            "format": "int64"
          },
          "apiKey": {
            "type": "string",
            "description": "Optional API key sent to the target URL when the webhook is called.",
            "nullable": true
          },
          "url": {
            "type": "string",
            "description": "Target address the webhook is called on."
          },
          "lastCallAt": {
            "type": "string",
            "description": "Timestamp of the last call attempt. Null if never called.",
            "format": "date-time",
            "nullable": true
          },
          "lastCallStatus": {
            "type": "integer",
            "description": "HTTP status code returned by the last call attempt. Null if never called.",
            "format": "int32",
            "nullable": true
          },
          "lastCallError": {
            "type": "string",
            "description": "Error message from the last failed call attempt. Null if the last call succeeded or none was made yet.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Webhook registration status for an organization/user combination."
      },
      "ElektronickyPostar.Shared.Models.Customs.Error": {
        "required": [
          "category",
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string",
            "description": "Unique error code"
          },
          "category": {
            "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorCategory"
          },
          "message": {
            "minLength": 1,
            "type": "string",
            "description": "Human-readable description"
          },
          "details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.ErrorDetail"
            },
            "description": "Detail error information."
          }
        },
        "additionalProperties": false,
        "description": "Structure of error message"
      },
      "ElektronickyPostar.Shared.Models.Customs.ErrorCategory": {
        "enum": [
          "AUTH",
          "VALIDATION",
          "PROCESSING",
          "TEMPORARY",
          "PERMANENT"
        ],
        "type": "string"
      },
      "ElektronickyPostar.Shared.Models.Customs.ErrorDetail": {
        "required": [
          "issue"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "description": "The field that caused the error",
            "nullable": true
          },
          "issue": {
            "minLength": 1,
            "type": "string",
            "description": "Description of the issue"
          },
          "value": {
            "type": "string",
            "description": "The invalid value that was provided",
            "nullable": true
          },
          "errorId": {
            "type": "string",
            "description": "PEPPOL rule identifier that failed, e.g. \"PEPPOL-EN16931-R010\".\nPopulated for Schematron validation errors; null otherwise.",
            "nullable": true
          },
          "artifactPath": {
            "type": "string",
            "description": "Path of the validation artifact (XSD or XSLT) that produced this error.\nPopulated for Schematron validation errors; null otherwise.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Structure of detail error message"
      },
      "ElektronickyPostar.Shared.Models.Customs.ErrorResponse": {
        "required": [
          "errors",
          "responseId",
          "status",
          "timestamp"
        ],
        "type": "object",
        "properties": {
          "responseId": {
            "type": "string",
            "description": "Response unique identifier",
            "format": "uuid"
          },
          "timestamp": {
            "type": "string",
            "description": "When the error occurred in UTC",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.StatusErrorResponse"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.Error"
            },
            "description": "List of errors ocured"
          }
        },
        "additionalProperties": false,
        "description": "Error response for errors with structured informations."
      },
      "ElektronickyPostar.Shared.Models.Customs.StatusErrorResponse": {
        "enum": [
          "REJECTED",
          "ERROR"
        ],
        "type": "string"
      },
      "ElektronickyPostar.Shared.Models.Customs.Transaction.OutgoingTransactionTagStatsModel": {
        "type": "object",
        "properties": {
          "sent": {
            "type": "integer",
            "format": "int32"
          },
          "delivered": {
            "type": "integer",
            "format": "int32"
          },
          "failed": {
            "type": "integer",
            "format": "int32"
          },
          "rejected": {
            "type": "integer",
            "format": "int32"
          },
          "sentWithoutResponse": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ElektronickyPostar.Shared.Models.Customs.UserModel": {
        "type": "object",
        "properties": {
          "Email": {
            "type": "string",
            "description": "User email address.",
            "format": "email"
          },
          "Name": {
            "type": "string",
            "description": "Gets the full display name.",
            "readOnly": true
          },
          "Title": {
            "type": "string",
            "description": "User title.",
            "nullable": true
          },
          "FirstName": {
            "type": "string",
            "description": "User first name."
          },
          "MiddleName": {
            "type": "string",
            "description": "User middle name.",
            "nullable": true
          },
          "SurName": {
            "type": "string",
            "description": "User last name."
          },
          "Roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "User roles, can be different than ManuRoles",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Represents an application user with role metadata."
      },
      "ElektronickyPostar.Shared.Models.Customs.WebhookDispatchPayload": {
        "type": "object",
        "properties": {
          "TransactionId": {
            "type": "integer",
            "description": "Gets or sets the transaction database ID.",
            "format": "int64"
          },
          "Status": {
            "type": "string",
            "description": "Gets or sets the resulting sending status: \"FAILED\" or \"REJECTED\"."
          },
          "Error": {
            "type": "string",
            "description": "Gets or sets the error message. Oxalis send error for FAILED, MLS description for REJECTED.",
            "nullable": true
          },
          "Code": {
            "type": "string",
            "description": "Gets or sets the MLS response code (e.g. \"RE\"). Only populated for REJECTED.",
            "nullable": true
          },
          "Transaction": {
            "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.WebhookTransactionModel"
          }
        },
        "additionalProperties": false,
        "description": "Body POSTed to a customer's registered webhook URL when an outgoing transaction transitions\nto FAILED or REJECTED. Distinct from ElektronickyPostar.Shared.Models.Customs.Events.OutgoingTransactionWebhookTriggerPayload\n(the internal Kafka trigger message) so the external, customer-facing contract can evolve\nindependently of the internal one."
      },
      "ElektronickyPostar.Shared.Models.Customs.WebhookTransactionEventModel": {
        "type": "object",
        "properties": {
          "Id": {
            "type": "integer",
            "description": "Gets or sets the event database ID.",
            "format": "int64"
          },
          "OccurredAt": {
            "type": "string",
            "description": "Gets or sets the timestamp when the event occurred.",
            "format": "date-time"
          },
          "OutgoingTransactionId": {
            "type": "integer",
            "description": "Gets or sets the ID of the transaction this event belongs to.",
            "format": "int64"
          },
          "OutgoingTransactionEventType": {
            "type": "string",
            "description": "Gets or sets the event type code (e.g. \"DOC_SEND_FAILED\", \"RETRY_EXHAUSTED\")."
          },
          "AdditionalInfo": {
            "type": "string",
            "description": "Gets or sets additional free-text information about the event.",
            "nullable": true
          },
          "Severity": {
            "type": "string",
            "description": "Gets or sets the event severity: 'I' Information, 'W' Warning, 'E' Error."
          },
          "TraceId": {
            "type": "string",
            "description": "Gets or sets the distributed-tracing trace ID associated with the event.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Event entry within ElektronickyPostar.Shared.Models.Customs.WebhookTransactionModel.Events."
      },
      "ElektronickyPostar.Shared.Models.Customs.WebhookTransactionModel": {
        "type": "object",
        "properties": {
          "Id": {
            "type": "integer",
            "description": "Gets or sets the transaction database ID.",
            "format": "int64"
          },
          "Status": {
            "type": "string",
            "description": "Gets or sets the resulting sending status: \"FAILED\" or \"REJECTED\"."
          },
          "CreatedAt": {
            "type": "string",
            "description": "Gets or sets the timestamp when the transaction was created.",
            "format": "date-time"
          },
          "CreatedBy": {
            "type": "integer",
            "description": "Gets or sets the ID of the user who created the transaction.",
            "format": "int64"
          },
          "LastSentAt": {
            "type": "string",
            "description": "Gets or sets the timestamp of the last send attempt.",
            "format": "date-time",
            "nullable": true
          },
          "ReceiverId": {
            "type": "string",
            "description": "Gets or sets the receiver's Peppol participant identifier.",
            "nullable": true
          },
          "ReceiverName": {
            "type": "string",
            "description": "Gets or sets the receiver's name.",
            "nullable": true
          },
          "DocumentNumber": {
            "type": "string",
            "description": "Gets or sets the document number.",
            "nullable": true
          },
          "DocumentTypeIdentifier": {
            "type": "string",
            "description": "Gets or sets the Document Type Identifier (DTI) BIS 3.0.",
            "nullable": true
          },
          "TransmissionId": {
            "type": "string",
            "description": "Gets or sets the transmission identifier from the SOAP response, when sent.",
            "nullable": true
          },
          "DocumentTypeCode": {
            "type": "string",
            "description": "Gets or sets the code identifying the document type (e.g. \"380\" for Invoice).",
            "nullable": true
          },
          "AttachmentCount": {
            "type": "integer",
            "description": "Gets or sets the number of attachments associated with the transaction.",
            "format": "int32",
            "nullable": true
          },
          "Deleted": {
            "type": "boolean",
            "description": "Gets or sets whether the transaction is soft-deleted."
          },
          "Tag": {
            "type": "string",
            "description": "Gets or sets the transaction's optional tag.",
            "nullable": true
          },
          "Events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElektronickyPostar.Shared.Models.Customs.WebhookTransactionEventModel"
            },
            "description": "Gets or sets the transaction's full event history, oldest first."
          }
        },
        "additionalProperties": false,
        "description": "Transaction shape sent as the `transaction` field of the outbound webhook payload\n(see ElektronickyPostar.Shared.Models.Customs.WebhookDispatchPayload). Deliberately a standalone model — NOT\nElektronickyPostar.Shared.Models.Customs.Transaction.OutgoingTransactionModel, the internal model also used for the\npublic API's own `GET /out-transaction/{id}` response — so that unrelated future\nchanges to that internal model can never silently change this external, customer-facing\ncontract. Mapped directly from DB entities in `WebhookMappings`."
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "description": "Retrieve a Keycloak access token (token endpoint: https://keycloak.test.softipdigitalnypostar.sk/realms/postar/protocol/openid-connect/token) and paste it into Swagger Authorize as 'Bearer <token>'.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "apikey": {
        "type": "apiKey",
        "description": "API Key header",
        "name": "X-API-KEY",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "bearer": [ ]
    },
    {
      "apikey": [ ]
    }
  ],
  "tags": [
    {
      "name": "Auth",
      "description": "Auth"
    },
    {
      "name": "Document",
      "description": "Send"
    },
    {
      "name": "Health"
    },
    {
      "name": "IncomingTransaction",
      "description": "ReceivedTransaction"
    },
    {
      "name": "Organization",
      "description": "Organization"
    },
    {
      "name": "OutgoingTransaction",
      "description": "SentTransaction"
    },
    {
      "name": "SapiAuth",
      "description": "SAPI Auth"
    },
    {
      "name": "SapiDocument",
      "description": "SAPI Document"
    },
    {
      "name": "WebhookRegister",
      "description": "Webhook"
    }
  ]
}