{
  "openapi": "3.1.1",
  "info": {
    "title": "SiSuInvoice API",
    "description": "API của SiSuInvoice – nhà cung cấp hóa đơn điện tử GIẢ LẬP phục vụ kiểm thử (không có giá trị pháp lý, không kết nối cơ quan thuế). Xác thực: POST /api/v1/auth/token với khóa API của đơn vị → Bearer token. Lỗi: thân ApiError { code, message, field, retryable, requestId }.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://invoice.sisunext.vn/"
    }
  ],
  "paths": {
    "/dang-xuat": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/tra-cuu/{code}/{kind}": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^(xml|pdf)$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/auth/token": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Đổi khóa API lấy token",
        "description": "Token Bearer có hạn (mặc định 60 phút). Khóa bị thu hồi / hết hạn → 401 với mã lỗi riêng.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/unit": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Thông tin đơn vị phát hành + đồng hồ của đơn vị",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/series": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Danh sách ký hiệu (mẫu số + ký hiệu, trạng thái, số mới nhất)",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/invoices/preview": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Xem nháp: tính lại tổng, cảnh báo, bản thể hiện HTML – không lưu",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/invoices": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Lập hóa đơn (phát hành ngay nếu issue = true)",
        "description": "Gửi lại cùng clientRef + cùng nội dung → trả hóa đơn đã có (nháp thì phát hành tiếp). Khác nội dung → 409 invoice.client-ref-conflict. Mất kết nối cơ quan thuế (mô phỏng) → 503 tax.unavailable, hóa đơn giữ nháp – gửi lại cùng clientRef.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Tra danh sách hóa đơn (lọc kỳ, trạng thái, ký hiệu, số, clientRef)",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/InvoiceStatus"
            }
          },
          {
            "name": "templateCode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "series",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "number",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int64"
            }
          },
          {
            "name": "clientRef",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pos",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/invoices/{id}": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Một hóa đơn theo id (hoặc ref:<clientRef>)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Sửa hóa đơn nháp / bị từ chối (giữ số, ngày đã cấp)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Xóa hóa đơn nháp chưa cấp số",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/invoices/{id}/issue": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Phát hành hóa đơn nháp / gửi lại hóa đơn bị từ chối",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/invoices/{id}/send": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Gửi hóa đơn cho người mua (thư có liên kết tra cứu)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/SendToBuyerRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/invoices/{id}/{kind}": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Tải XML đã ký / PDF bản thể hiện / PDF bản chuyển đổi",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^(xml|pdf|converted)$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/invoices/{id}/adjust": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Lập hóa đơn điều chỉnh (tăng ghi dương, giảm ghi âm)",
        "description": "reasonCode (LDDCTThe): 13 sai sót (mặc định), 4 chiết khấu, 5 trả lại hàng… Người mua có MST / mã ĐVQHNS: agreementNo + agreementDate bắt buộc khi reasonCode 13 / 14.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RelatedInvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/invoices/{id}/replace": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Lập hóa đơn thay thế",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RelatedInvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/invoices/{id}/cancel": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Hủy (mô phỏng – không có trong quy định hiện hành; chỉ khi đơn vị bật cho phép hủy)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/invoices/{id}/attachments": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Đính kèm biên bản thỏa thuận (PDF / ảnh ≤ 5 MB)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/error-notices": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Thông báo hóa đơn có sai sót / giải trình (04/SS-HĐĐT)",
        "description": "nature: Notify (sai tên, địa chỉ người mua… – không lập lại hóa đơn) hoặc Explain (giải trình theo thông báo rà soát của cơ quan thuế).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ErrorNoticeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/error-notices/{id}": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Một thông báo 04/SS",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/pos-invoices": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Lập + phát hành hóa đơn khởi tạo từ máy tính tiền (1 – 500 / lần)",
        "description": "Mã hóa đơn 23 ký tự do phần mềm tự sinh – có ngay, không chờ cơ quan thuế. Dữ liệu chuyển cơ quan thuế cuối ngày (hoặc ngay nếu đơn vị chọn).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PosBatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/pos-invoices/transfer": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "summary": "Chuyển ngay dữ liệu hóa đơn máy tính tiền đang chờ",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/portal-api/site": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteInfoDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/lookup/{code}": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/portal-api/check-xml": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/XmlCheckRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/XmlCheckDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/me": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/me/password": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/portal-api/units": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UnitCardDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUnitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedUnitDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/system": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemOverviewDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/system/accounts/{id}/toggle-lock": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/system/mail": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeMailStateDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveNodeMailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/system/mail/test": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestNodeMailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeMailTestDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/system/mail/mode": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetNodeMailModeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/system/mail/source": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetNodeMailSourceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/system/link": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeLinkStateDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/system/logs": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "dn",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeLogDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/system/databases": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeDatabaseDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnitSessionDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/dashboard": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/invoices": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/InvoiceStatus"
            }
          },
          {
            "name": "series",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pos",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "review",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceListDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/invoices/{id}": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDetailDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/invoices/{id}/action": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/invoices/{id}/attachments": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileUpload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/invoice-form": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceFormDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveInvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedInvoiceDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/invoice-form/preview": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveInvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewResult"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/import": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/error-notices": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorNoticePageDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ErrorNoticeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/summaries": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryPageDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SummaryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/report": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/registration": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrationPageDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegistrationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrationResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/series": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesPageDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSeriesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/series/{id}/stop": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/series/{id}": {
      "delete": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/catalog": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/catalog/customers": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/catalog/customers/{id}": {
      "delete": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/catalog/products": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/catalog/products/{id}": {
      "delete": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/template": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplatePageDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplatePageDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/info": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnitInfoDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnitInfoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/info/renew-certificate": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/members": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembersDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/members/invite": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/members/{id}/role": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberRoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/api-keys": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeysDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedApiKeyDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/api-keys/{id}/revoke": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/webhook": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookPageDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSavedDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/webhook/test": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/webhook/deliveries/{id}/retry": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/api-calls": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiCallDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/messages": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TaxMessageDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/mails": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MailDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/activities": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ActivityDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/tools": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolsDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/tools/simulation": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimulationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/tools/clock": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClockRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/tools/options": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptionsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/tools/quota": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotaRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/tools/stop-usage": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StopUsageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/tools/resume-usage": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/tools/transfer-pos": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/tools/seed": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/portal-api/u/{tax}/tools/reset": {
      "post": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/u/{tax}/hoa-don/{id}/{kind}": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^(xml|pdf|chuyen-doi)$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/u/{tax}/dinh-kem/{id}": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/u/{tax}/thong-diep/{id}/xml": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/u/{tax}/bao-cao/bang-ke": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/u/{tax}/nhap-excel/mau": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/u/{tax}/logo": {
      "get": {
        "tags": [
          "SiSuInvoice"
        ],
        "parameters": [
          {
            "name": "tax",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AccountDto": {
        "required": [
          "id",
          "email",
          "fullName",
          "isSystemAdmin",
          "createdAt",
          "lastLoginAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "isSystemAdmin": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastLoginAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ActionResultDto": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "ActivityDto": {
        "required": [
          "at",
          "actor",
          "action",
          "target",
          "detail"
        ],
        "type": "object",
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "actor": {
            "type": [
              "null",
              "string"
            ]
          },
          "action": {
            "type": "string"
          },
          "target": {
            "type": [
              "null",
              "string"
            ]
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ApiCallDto": {
        "required": [
          "at",
          "method",
          "path",
          "statusCode",
          "durationMs",
          "errorCode",
          "requestId",
          "clientRef",
          "requestBody",
          "responseBody"
        ],
        "type": "object",
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "method": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "statusCode": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "durationMs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "errorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "requestId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientRef": {
            "type": [
              "null",
              "string"
            ]
          },
          "requestBody": {
            "type": [
              "null",
              "string"
            ]
          },
          "responseBody": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ApiKeyDto": {
        "required": [
          "id",
          "name",
          "prefix",
          "scopes",
          "createdAt",
          "expiresAt",
          "lastUsedAt",
          "state",
          "active"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "scopes": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastUsedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "state": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "ApiKeysDto": {
        "required": [
          "tokenUrl",
          "keys",
          "scopes"
        ],
        "type": "object",
        "properties": {
          "tokenUrl": {
            "type": "string"
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKeyDto"
            }
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AttachmentDto": {
        "required": [
          "id",
          "fileName",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "fileName": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BuyerInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Tên đơn vị mua hàng (tổ chức) – hoặc tên người mua nếu là cá nhân."
          },
          "personName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Họ tên người mua hàng (người đại diện mua của tổ chức)."
          },
          "taxCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "budgetUnitCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "idNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "passportNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "nationalityCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "Quốc tịch người mua nước ngoài – mã ISO 3166-1 alpha-2 (thẻ `MQTNMua`), đi kèm số hộ chiếu."
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "bankAccount": {
            "type": [
              "null",
              "string"
            ]
          },
          "bankName": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "Mã khách trong phần mềm của bên gọi (tùy chọn)."
          }
        },
        "description": "Người mua. Định danh theo thứ tự: `taxCode` (MST) → `budgetUnitCode` (mã ĐVQHNS) → `idNumber` (số định danh cá nhân);\r\n            không có cả ba và không có tên → hóa đơn ghi \"Bán cho người tiêu dùng\"."
      },
      "CancelRequest": {
        "required": [
          "reason"
        ],
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      },
      "CatalogDto": {
        "required": [
          "customers",
          "products",
          "taxRates"
        ],
        "type": "object",
        "properties": {
          "customers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerDto"
            }
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductDto"
            }
          },
          "taxRates": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ChangePasswordRequest": {
        "type": "object",
        "properties": {
          "current": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "password2": {
            "type": "string"
          }
        }
      },
      "ClockRequest": {
        "type": "object",
        "properties": {
          "reset": {
            "type": "boolean"
          },
          "fixedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "offsetDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "CreateApiKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "expiresOn": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CreatedApiKeyDto": {
        "required": [
          "key"
        ],
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          }
        }
      },
      "CreatedUnitDto": {
        "required": [
          "taxCode",
          "message"
        ],
        "type": "object",
        "properties": {
          "taxCode": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "CreateSeriesRequest": {
        "type": "object",
        "properties": {
          "templateCode": {
            "type": "string"
          },
          "withCode": {
            "type": "string"
          },
          "year": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "typeCode": {
            "type": "string"
          },
          "suffix": {
            "type": "string"
          }
        }
      },
      "CreateUnitRequest": {
        "type": "object",
        "properties": {
          "taxCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "seed": {
            "type": "boolean"
          }
        }
      },
      "CustomerDto": {
        "required": [
          "id",
          "code",
          "name",
          "personName",
          "taxCode",
          "budgetUnitCode",
          "idNumber",
          "address",
          "email",
          "phone",
          "bankAccount",
          "bankName"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "personName": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "budgetUnitCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "idNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "bankAccount": {
            "type": [
              "null",
              "string"
            ]
          },
          "bankName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CustomerRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "personName": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "budgetUnitCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "idNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DashboardDto": {
        "required": [
          "now",
          "simulatedClock",
          "warnings",
          "issuedThisMonth",
          "amountThisMonth",
          "drafts",
          "waiting",
          "rejected",
          "posPending",
          "series",
          "recent"
        ],
        "type": "object",
        "properties": {
          "now": {
            "type": "string",
            "format": "date-time"
          },
          "simulatedClock": {
            "type": "boolean"
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoticeDto"
            }
          },
          "issuedThisMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "amountThisMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "drafts": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "waiting": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rejected": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "posPending": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SeriesRowDto"
            }
          },
          "recent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceRowDto"
            }
          }
        }
      },
      "ErrorNoticeItemInput": {
        "required": [
          "invoiceId",
          "nature",
          "reason"
        ],
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "nature": {
            "$ref": "#/components/schemas/ErrorNoticeNature"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "ErrorNoticeNature": {
        "enum": [
          "Notify",
          "Explain"
        ],
        "description": "Thông báo 04/SS-HĐĐT (Thông tư 91/2026 Điều 10 + Phụ lục III): cột \"Thông báo / Giải trình\" của từng hóa đơn. Mẫu hiện hành <b>không còn</b> tính chất\r\nhủy / điều chỉnh / thay thế – điều chỉnh, thay thế lập hóa đơn mới, không cần 04/SS."
      },
      "ErrorNoticePageDto": {
        "required": [
          "candidates",
          "notices",
          "place"
        ],
        "type": "object",
        "properties": {
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceOptionDto"
            }
          },
          "notices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorNoticeRowDto"
            }
          },
          "place": {
            "type": "string"
          }
        }
      },
      "ErrorNoticeRequest": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorNoticeItemInput"
            }
          },
          "place": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "`POST /api/v1/error-notices` – thông báo hóa đơn điện tử đã lập có sai sót (04/SS-HĐĐT)."
      },
      "ErrorNoticeRowDto": {
        "required": [
          "createdAt",
          "items",
          "statusText",
          "response"
        ],
        "type": "object",
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "statusText": {
            "type": "string"
          },
          "response": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "FileUpload": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string"
          },
          "contentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "content": {
            "type": "string",
            "format": "byte"
          }
        }
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "ImportRequest": {
        "type": "object",
        "properties": {
          "file": {
            "$ref": "#/components/schemas/FileUpload"
          },
          "issue": {
            "type": "boolean"
          }
        }
      },
      "ImportResultDto": {
        "required": [
          "invoices",
          "errors",
          "clientRefs"
        ],
        "type": "object",
        "properties": {
          "invoices": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "clientRefs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "InvitationDto": {
        "required": [
          "email",
          "role",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/PortalRole"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InviteRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/PortalRole"
          }
        }
      },
      "InvoiceActionRequest": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "nature": {
            "$ref": "#/components/schemas/ErrorNoticeNature"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "InvoiceDetailDto": {
        "required": [
          "id",
          "templateCode",
          "series",
          "number",
          "status",
          "kindName",
          "reasonText",
          "clientRef",
          "issueDate",
          "signedAt",
          "issuedAt",
          "taxAuthorityCode",
          "lookupCode",
          "totalAmount",
          "currency",
          "sentToBuyerAt",
          "convertedCount",
          "errorMethodText",
          "buyerEmail",
          "isPos",
          "transferPending",
          "rejectReason",
          "reviewReason",
          "hasXml",
          "allowCancel",
          "related",
          "children",
          "attachments",
          "messages",
          "activities",
          "html"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "templateCode": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/InvoiceStatus"
          },
          "kindName": {
            "type": "string"
          },
          "reasonText": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientRef": {
            "type": "string"
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "signedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "issuedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "taxAuthorityCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "lookupCode": {
            "type": "string"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "currency": {
            "type": "string"
          },
          "sentToBuyerAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "convertedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "errorMethodText": {
            "type": [
              "null",
              "string"
            ]
          },
          "buyerEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPos": {
            "type": "boolean"
          },
          "transferPending": {
            "type": "boolean"
          },
          "rejectReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "reviewReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasXml": {
            "type": "boolean"
          },
          "allowCancel": {
            "type": "boolean"
          },
          "related": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/InvoiceLinkDto"
              }
            ]
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLinkDto"
            }
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttachmentDto"
            }
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxMessageDto"
            }
          },
          "activities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActivityDto"
            }
          },
          "html": {
            "type": "string"
          },
          "isIssued": {
            "type": "boolean"
          },
          "isEditable": {
            "type": "boolean"
          },
          "canCorrect": {
            "type": "boolean"
          }
        }
      },
      "InvoiceFormDto": {
        "required": [
          "mode",
          "posMode",
          "clientRef",
          "today",
          "series",
          "customers",
          "products",
          "taxRates",
          "source",
          "original",
          "reasonCode",
          "reason",
          "canIssue"
        ],
        "type": "object",
        "properties": {
          "mode": {
            "type": "string"
          },
          "posMode": {
            "type": "boolean"
          },
          "clientRef": {
            "type": "string"
          },
          "today": {
            "type": "string",
            "format": "date"
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SeriesOptionDto"
            }
          },
          "customers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerDto"
            }
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductDto"
            }
          },
          "taxRates": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/InvoiceRequest"
              }
            ]
          },
          "original": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OriginalInvoiceDto"
              }
            ]
          },
          "reasonCode": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "canIssue": {
            "type": "boolean"
          }
        }
      },
      "InvoiceLineInput": {
        "type": "object",
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/LineKind"
          },
          "itemCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "itemName": {
            "type": "string"
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Tỷ lệ chiết khấu trên dòng (%).",
            "format": "double"
          },
          "discountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Tiền chiết khấu trên dòng.",
            "format": "double"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Thành tiền chưa thuế (= SL × đơn giá − chiết khấu dòng; dòng chiết khấu thương mại: số tiền chiết khấu, dương). Bỏ trống thì máy chủ tính.",
            "format": "double"
          },
          "taxRate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Mã thuế suất: `0%`, `5%`, `8%`, `10%`, `KCT`, `KKKNT`, `KHAC:AB.CD%`. Bỏ trống với hóa đơn bán hàng (mẫu 2)."
          },
          "taxAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Tiền thuế của dòng (tùy chọn – máy chủ tính và đối chiếu theo từng thuế suất).",
            "format": "double"
          },
          "extra": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Thông tin thêm (hàng đặc trưng: số khung, số máy…)."
          }
        }
      },
      "InvoiceLinkDto": {
        "required": [
          "id",
          "label",
          "note"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "InvoiceListDto": {
        "required": [
          "items",
          "total",
          "page",
          "pageSize",
          "seriesOptions"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceRowDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "seriesOptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "InvoiceOptionDto": {
        "required": [
          "id",
          "label"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "InvoiceRequest": {
        "type": "object",
        "properties": {
          "clientRef": {
            "type": "string",
            "description": "Khóa chống trùng do bên gọi cấp (≤ 64 ký tự, duy nhất trong đơn vị). Gửi lại cùng giá trị → trả hóa đơn đã có, không tạo mới."
          },
          "templateCode": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "issueDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Ngày lập. Bỏ trống = hôm nay (theo đồng hồ của đơn vị).",
            "format": "date"
          },
          "currency": {
            "type": "string"
          },
          "exchangeRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "paymentMethod": {
            "type": [
              "null",
              "string"
            ],
            "description": "Hình thức thanh toán (TM, CK, TM/CK…)."
          },
          "buyer": {
            "$ref": "#/components/schemas/BuyerInput"
          },
          "sellerLocationCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "Mã địa điểm kinh doanh của người bán (hộ nhiều cửa hàng, xăng dầu…); trống = mã của đơn vị."
          },
          "sellerLocationName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Tên / địa chỉ địa điểm kinh doanh (đi cùng mã – thẻ `TDDKDoanh`, `DCDDKDoanh`)."
          },
          "sellerLocationAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineInput"
            }
          },
          "totalBeforeTax": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Tổng tiền chưa thuế / tiền thuế / tổng thanh toán bên gọi tính – máy chủ đối chiếu (lệch quá 1 đồng → lỗi `validation.totals`).",
            "format": "double"
          },
          "taxTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "issue": {
            "type": "boolean",
            "description": "true = cấp số + ký + gửi cơ quan thuế ngay; false = lưu nháp."
          },
          "sendToBuyer": {
            "type": "boolean",
            "description": "Gửi người mua sau khi được cấp mã (email ở `buyer.email`)."
          }
        },
        "description": "`POST /api/v1/invoices` – lập hóa đơn (và phát hành ngay nếu `issue = true`)."
      },
      "InvoiceRowDto": {
        "required": [
          "id",
          "templateCode",
          "series",
          "number",
          "issueDate",
          "buyerName",
          "buyerTaxCode",
          "totalAmount",
          "currency",
          "status",
          "kindName",
          "transferPending",
          "reviewRequested",
          "clientRef"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "templateCode": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "buyerName": {
            "type": "string"
          },
          "buyerTaxCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "currency": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/InvoiceStatus"
          },
          "kindName": {
            "type": "string"
          },
          "transferPending": {
            "type": "boolean"
          },
          "reviewRequested": {
            "type": "boolean"
          },
          "clientRef": {
            "type": "string"
          }
        }
      },
      "InvoiceStatus": {
        "enum": [
          "Draft",
          "Signed",
          "Sent",
          "Issued",
          "Rejected",
          "Adjusted",
          "Replaced",
          "Cancelled",
          null
        ]
      },
      "LineKind": {
        "enum": [
          "Goods",
          "Promotion",
          "TradeDiscount",
          "Note",
          "Special"
        ],
        "description": "Tính chất dòng hàng hóa, dịch vụ (thẻ `TChat`)."
      },
      "MailDto": {
        "required": [
          "id",
          "at",
          "to",
          "subject",
          "htmlBody",
          "deliveryError"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "htmlBody": {
            "type": "string"
          },
          "deliveryError": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "MemberDto": {
        "required": [
          "accountId",
          "email",
          "name",
          "role",
          "isMe"
        ],
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/PortalRole"
          },
          "isMe": {
            "type": "boolean"
          }
        }
      },
      "MemberRoleRequest": {
        "type": "object",
        "properties": {
          "role": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PortalRole"
              }
            ]
          }
        }
      },
      "MembersDto": {
        "required": [
          "members",
          "invitations"
        ],
        "type": "object",
        "properties": {
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MemberDto"
            }
          },
          "invitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvitationDto"
            }
          }
        }
      },
      "NodeDatabaseDto": {
        "required": [
          "name",
          "sizeMb",
          "kind",
          "tenantCode",
          "tenantId"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "sizeMb": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "kind": {
            "type": "string"
          },
          "tenantCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "tenantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "NodeLinkStateDto": {
        "required": [
          "linked",
          "panelUrl",
          "urls",
          "onFallback",
          "nodeName",
          "mode",
          "channel",
          "maxTenants",
          "baseUrl",
          "lastSyncAt",
          "lastError",
          "version",
          "longOffline"
        ],
        "type": "object",
        "properties": {
          "linked": {
            "type": "boolean"
          },
          "panelUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "onFallback": {
            "type": "boolean"
          },
          "nodeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "mode": {
            "type": [
              "null",
              "string"
            ]
          },
          "channel": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxTenants": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "baseUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastSyncAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastError": {
            "type": [
              "null",
              "string"
            ]
          },
          "version": {
            "type": "string"
          },
          "longOffline": {
            "type": "boolean"
          }
        }
      },
      "NodeLogDto": {
        "required": [
          "at",
          "action",
          "tenantCode",
          "userName",
          "succeeded",
          "detail"
        ],
        "type": "object",
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "action": {
            "type": "string"
          },
          "tenantCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "userName": {
            "type": [
              "null",
              "string"
            ]
          },
          "succeeded": {
            "type": "boolean"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "NodeMailStateDto": {
        "required": [
          "host",
          "port",
          "user",
          "hasPassword",
          "from",
          "startTls",
          "mode",
          "pinned",
          "lastTestAt",
          "lastTestOk",
          "lastTestDetail"
        ],
        "type": "object",
        "properties": {
          "host": {
            "type": [
              "null",
              "string"
            ]
          },
          "port": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "user": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasPassword": {
            "type": "boolean"
          },
          "from": {
            "type": [
              "null",
              "string"
            ]
          },
          "startTls": {
            "type": "boolean"
          },
          "mode": {
            "type": "string"
          },
          "pinned": {
            "type": "boolean"
          },
          "lastTestAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastTestOk": {
            "type": "boolean"
          },
          "lastTestDetail": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": "string",
            "default": "own"
          },
          "panelProvided": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "NodeMailTestDto": {
        "required": [
          "ok",
          "detail"
        ],
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "NoticeDto": {
        "required": [
          "text"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "linkText": {
            "type": [
              "null",
              "string"
            ]
          },
          "linkHref": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OptionsRequest": {
        "type": "object",
        "properties": {
          "deterministic": {
            "type": "boolean"
          },
          "seed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "testHeaders": {
            "type": "boolean"
          },
          "allowCancel": {
            "type": "boolean"
          },
          "posMode": {
            "type": "string"
          }
        }
      },
      "OriginalInvoiceDto": {
        "required": [
          "id",
          "label",
          "issueDate",
          "buyerName",
          "totalAmount"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "buyerName": {
            "type": "string"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "PortalRole": {
        "type": "integer"
      },
      "PosBatchRequest": {
        "required": [
          "invoices"
        ],
        "type": "object",
        "properties": {
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceRequest"
            }
          }
        },
        "description": "`POST /api/v1/pos-invoices` – một hoặc nhiều hóa đơn khởi tạo từ máy tính tiền (tối đa 500 / lần). Trả kết quả từng hóa đơn theo thứ tự gửi."
      },
      "PreviewResult": {
        "required": [
          "totalBeforeTax",
          "taxTotal",
          "totalAmount",
          "amountInWords",
          "taxBreakdown",
          "warnings",
          "html"
        ],
        "type": "object",
        "properties": {
          "totalBeforeTax": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "taxTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "amountInWords": {
            "type": "string"
          },
          "taxBreakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxBreakdown"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "html": {
            "type": "string"
          }
        },
        "description": "Kết quả xem nháp: tổng tính lại + cảnh báo + bản thể hiện HTML (không lưu, không cấp số)."
      },
      "ProductDto": {
        "required": [
          "id",
          "code",
          "name",
          "unit",
          "unitPrice",
          "taxRate"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "taxRate": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProductRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "taxRate": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "QuotaRequest": {
        "type": "object",
        "properties": {
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "expiresOn": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          }
        }
      },
      "RegistrationDto": {
        "required": [
          "createdAt",
          "respondedAt",
          "isNew",
          "useWithCode",
          "useWithoutCode",
          "usePos",
          "posWithCode",
          "templateCodes",
          "sendEachInvoice",
          "statusText",
          "reason",
          "representativeName",
          "representativeId",
          "contactName",
          "contactEmail",
          "contactPhone"
        ],
        "type": "object",
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "respondedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isNew": {
            "type": "boolean"
          },
          "useWithCode": {
            "type": "boolean"
          },
          "useWithoutCode": {
            "type": "boolean"
          },
          "usePos": {
            "type": "boolean"
          },
          "posWithCode": {
            "type": "boolean"
          },
          "templateCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sendEachInvoice": {
            "type": "boolean"
          },
          "statusText": {
            "type": "string"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "representativeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "representativeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RegistrationPageDto": {
        "required": [
          "current",
          "history",
          "templates",
          "posRangeCode",
          "defaultContact",
          "defaultEmail"
        ],
        "type": "object",
        "properties": {
          "current": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RegistrationDto"
              }
            ]
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RegistrationDto"
            }
          },
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateOptionDto"
            }
          },
          "posRangeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultContact": {
            "type": "string"
          },
          "defaultEmail": {
            "type": "string"
          }
        }
      },
      "RegistrationRequest": {
        "type": "object",
        "properties": {
          "useWithCode": {
            "type": "boolean"
          },
          "useWithoutCode": {
            "type": "boolean"
          },
          "usePos": {
            "type": "boolean"
          },
          "posWithCode": {
            "type": "boolean"
          },
          "templateCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sendEachInvoice": {
            "type": "boolean"
          },
          "representativeName": {
            "type": "string"
          },
          "representativeId": {
            "type": "string"
          },
          "contactName": {
            "type": "string"
          },
          "contactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RegistrationResultDto": {
        "required": [
          "accepted",
          "message"
        ],
        "type": "object",
        "properties": {
          "accepted": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "RelatedInvoiceRequest": {
        "type": "object",
        "properties": {
          "invoice": {
            "$ref": "#/components/schemas/InvoiceRequest"
          },
          "reason": {
            "type": "string",
            "description": "Lý do điều chỉnh / thay thế (in lên hóa đơn – thẻ `GChu`)."
          },
          "reasonCode": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Mã lý do (AdjustmentReasons, thẻ `LDDCTThe`). Mặc định 13 – hóa đơn đã lập có sai sót.",
            "format": "int32"
          },
          "agreementNo": {
            "type": [
              "null",
              "string"
            ],
            "description": "Số / ngày văn bản thỏa thuận với người mua (nếu có)."
          },
          "agreementDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          }
        },
        "description": "`POST /api/v1/invoices/{id}/adjust` và `/replace`: hóa đơn mới tham chiếu hóa đơn gốc."
      },
      "ReportDto": {
        "required": [
          "from",
          "to",
          "usage"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "usage": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageRowDto"
            }
          }
        }
      },
      "SavedInvoiceDto": {
        "required": [
          "id",
          "message"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "SaveInvoiceRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string"
          },
          "sourceId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "invoice": {
            "$ref": "#/components/schemas/InvoiceRequest"
          },
          "reasonCode": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "agreementNo": {
            "type": [
              "null",
              "string"
            ]
          },
          "agreementDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          }
        }
      },
      "SaveNodeMailRequest": {
        "required": [
          "host",
          "port",
          "user",
          "password",
          "from",
          "startTls",
          "confirmPassword"
        ],
        "type": "object",
        "properties": {
          "host": {
            "type": [
              "null",
              "string"
            ]
          },
          "port": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "user": {
            "type": [
              "null",
              "string"
            ]
          },
          "password": {
            "type": [
              "null",
              "string"
            ]
          },
          "from": {
            "type": [
              "null",
              "string"
            ]
          },
          "startTls": {
            "type": "boolean"
          },
          "confirmPassword": {
            "type": "string"
          }
        }
      },
      "SendToBuyerRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SeriesOptionDto": {
        "required": [
          "templateCode",
          "series",
          "name",
          "usesVat"
        ],
        "type": "object",
        "properties": {
          "templateCode": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "usesVat": {
            "type": "boolean"
          },
          "key": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SeriesPageDto": {
        "required": [
          "items",
          "templates",
          "types",
          "year"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SeriesRowDto"
            }
          },
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateOptionDto"
            }
          },
          "types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SeriesTypeDto"
            }
          },
          "year": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SeriesRowDto": {
        "required": [
          "id",
          "templateCode",
          "series",
          "description",
          "status",
          "stopReason",
          "lastNumber",
          "lastIssueDate"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "templateCode": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/SeriesStatus"
          },
          "stopReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "lastIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          }
        }
      },
      "SeriesStatus": {
        "enum": [
          "PendingReceipt",
          "PendingAcceptance",
          "Active",
          "Stopped",
          "Expired",
          "Rejected"
        ],
        "description": "Trạng thái ký hiệu hóa đơn."
      },
      "SeriesTypeDto": {
        "required": [
          "code",
          "description"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "SetNodeMailModeRequest": {
        "required": [
          "mode"
        ],
        "type": "object",
        "properties": {
          "mode": {
            "type": "string"
          }
        }
      },
      "SetNodeMailSourceRequest": {
        "required": [
          "own"
        ],
        "type": "object",
        "properties": {
          "own": {
            "type": "boolean"
          }
        }
      },
      "SimulationRequest": {
        "type": "object",
        "properties": {
          "reject": {
            "type": "boolean"
          },
          "rejectReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "delaySeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "offline": {
            "type": "boolean"
          },
          "seriesStopped": {
            "type": "boolean"
          },
          "quotaExceeded": {
            "type": "boolean"
          },
          "duplicateNumber": {
            "type": "boolean"
          }
        }
      },
      "SiteInfoDto": {
        "required": [
          "version",
          "publicUrl"
        ],
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "publicUrl": {
            "type": "string"
          }
        }
      },
      "StopUsageRequest": {
        "type": "object",
        "properties": {
          "posOnly": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "StyleOptionDto": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "SummaryPageDto": {
        "required": [
          "defaultFrom",
          "defaultTo",
          "items"
        ],
        "type": "object",
        "properties": {
          "defaultFrom": {
            "type": "string",
            "format": "date"
          },
          "defaultTo": {
            "type": "string",
            "format": "date"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SummaryRowDto"
            }
          }
        }
      },
      "SummaryRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "SummaryRowDto": {
        "required": [
          "id",
          "from",
          "to",
          "sequence",
          "invoiceCount",
          "totalBeforeTax",
          "taxTotal",
          "totalAmount",
          "accepted",
          "response",
          "createdAt",
          "messageId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "sequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "invoiceCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalBeforeTax": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "taxTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "accepted": {
            "type": "boolean"
          },
          "response": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "messageId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "SystemAccountDto": {
        "required": [
          "id",
          "email",
          "fullName",
          "isSystemAdmin",
          "lastLoginAt",
          "isLocked",
          "isMe"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "isSystemAdmin": {
            "type": "boolean"
          },
          "lastLoginAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isLocked": {
            "type": "boolean"
          },
          "isMe": {
            "type": "boolean"
          }
        }
      },
      "SystemOverviewDto": {
        "required": [
          "units",
          "accounts",
          "invoices",
          "messages",
          "unitList",
          "accountList"
        ],
        "type": "object",
        "properties": {
          "units": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "accounts": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "invoices": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "messages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "unitList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SystemUnitDto"
            }
          },
          "accountList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SystemAccountDto"
            }
          }
        }
      },
      "SystemUnitDto": {
        "required": [
          "taxCode",
          "name",
          "createdAt",
          "invoices",
          "usageStopped"
        ],
        "type": "object",
        "properties": {
          "taxCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "invoices": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "usageStopped": {
            "type": "boolean"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "app": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TaxBreakdown": {
        "required": [
          "taxRate",
          "amount",
          "taxAmount"
        ],
        "type": "object",
        "properties": {
          "taxRate": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "taxAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "TaxMessageDto": {
        "required": [
          "id",
          "at",
          "outgoing",
          "type",
          "typeName",
          "summary",
          "messageId",
          "referenceId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "outgoing": {
            "type": "boolean"
          },
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "typeName": {
            "type": "string"
          },
          "summary": {
            "type": [
              "null",
              "string"
            ]
          },
          "messageId": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TemplateOptionDto": {
        "required": [
          "code",
          "name",
          "usesVat"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "usesVat": {
            "type": "boolean"
          }
        }
      },
      "TemplatePageDto": {
        "required": [
          "style",
          "color",
          "footer",
          "showLogo",
          "showBank",
          "hasLogo",
          "styles",
          "previewHtml"
        ],
        "type": "object",
        "properties": {
          "style": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "footer": {
            "type": [
              "null",
              "string"
            ]
          },
          "showLogo": {
            "type": "boolean"
          },
          "showBank": {
            "type": "boolean"
          },
          "hasLogo": {
            "type": "boolean"
          },
          "styles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StyleOptionDto"
            }
          },
          "previewHtml": {
            "type": "string"
          }
        }
      },
      "TemplateRequest": {
        "type": "object",
        "properties": {
          "style": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "footer": {
            "type": [
              "null",
              "string"
            ]
          },
          "showLogo": {
            "type": "boolean"
          },
          "showBank": {
            "type": "boolean"
          },
          "removeLogo": {
            "type": "boolean"
          },
          "logo": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FileUpload"
              }
            ]
          }
        }
      },
      "TestNodeMailRequest": {
        "required": [
          "to"
        ],
        "type": "object",
        "properties": {
          "to": {
            "type": "string"
          }
        }
      },
      "TokenRequest": {
        "required": [
          "apiKey"
        ],
        "type": "object",
        "properties": {
          "apiKey": {
            "type": "string"
          }
        },
        "description": "`POST /api/v1/auth/token`: đổi khóa API lấy token ngắn hạn (mặc định 60 phút)."
      },
      "ToolsDto": {
        "required": [
          "simulation",
          "now",
          "clockFixedAt",
          "clockOffsetDays",
          "options",
          "quotaUsed",
          "quotaTotal",
          "quotaExpiresOn"
        ],
        "type": "object",
        "properties": {
          "simulation": {
            "$ref": "#/components/schemas/SimulationRequest"
          },
          "now": {
            "type": "string",
            "format": "date-time"
          },
          "clockFixedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "clockOffsetDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "options": {
            "$ref": "#/components/schemas/OptionsRequest"
          },
          "quotaUsed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "quotaTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "quotaExpiresOn": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          }
        }
      },
      "UnitCardDto": {
        "required": [
          "taxCode",
          "name",
          "role"
        ],
        "type": "object",
        "properties": {
          "taxCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/PortalRole"
          }
        }
      },
      "UnitInfoDto": {
        "required": [
          "taxCode",
          "info",
          "certificateSubject",
          "certificateSerial",
          "certificateNotAfter"
        ],
        "type": "object",
        "properties": {
          "taxCode": {
            "type": "string"
          },
          "info": {
            "$ref": "#/components/schemas/UnitInfoRequest"
          },
          "certificateSubject": {
            "type": [
              "null",
              "string"
            ]
          },
          "certificateSerial": {
            "type": [
              "null",
              "string"
            ]
          },
          "certificateNotAfter": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "UnitInfoRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "website": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxOffice": {
            "type": [
              "null",
              "string"
            ]
          },
          "bankAccount": {
            "type": [
              "null",
              "string"
            ]
          },
          "bankName": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationAddress": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UnitSessionDto": {
        "required": [
          "taxCode",
          "name",
          "role"
        ],
        "type": "object",
        "properties": {
          "taxCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/PortalRole"
          }
        }
      },
      "UsageRowDto": {
        "required": [
          "templateCode",
          "series",
          "firstNumber",
          "lastNumber",
          "used",
          "issued",
          "rejected",
          "adjusted",
          "replaced",
          "cancelled",
          "draft"
        ],
        "type": "object",
        "properties": {
          "templateCode": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "firstNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "lastNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "used": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "issued": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rejected": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "adjusted": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "replaced": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "cancelled": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "draft": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "WebhookDeliveryDto": {
        "required": [
          "id",
          "createdAt",
          "eventType",
          "statusText",
          "delivered",
          "attempts",
          "lastStatusCode",
          "lastError",
          "payload"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "eventType": {
            "type": "string"
          },
          "statusText": {
            "type": "string"
          },
          "delivered": {
            "type": "boolean"
          },
          "attempts": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastStatusCode": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastError": {
            "type": [
              "null",
              "string"
            ]
          },
          "payload": {
            "type": "string"
          }
        }
      },
      "WebhookPageDto": {
        "required": [
          "url",
          "events",
          "hasSecret",
          "deliveries",
          "maxAttempts"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hasSecret": {
            "type": "boolean"
          },
          "deliveries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryDto"
            }
          },
          "maxAttempts": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "WebhookRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "newSecret": {
            "type": "boolean"
          }
        }
      },
      "WebhookSavedDto": {
        "required": [
          "message",
          "secret"
        ],
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "secret": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "XmlCheckDto": {
        "required": [
          "valid",
          "templateCode",
          "series",
          "number",
          "sellerTaxCode",
          "taxCode",
          "sellerSignature",
          "taxSignature",
          "problems"
        ],
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "templateCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "series": {
            "type": [
              "null",
              "string"
            ]
          },
          "number": {
            "type": [
              "null",
              "string"
            ]
          },
          "sellerTaxCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "sellerSignature": {
            "type": "string"
          },
          "taxSignature": {
            "type": "string"
          },
          "problems": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "XmlCheckRequest": {
        "required": [
          "xml"
        ],
        "type": "object",
        "properties": {
          "xml": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "Token từ POST /api/v1/auth/token (mặc định 60 phút).",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "SiSuInvoice"
    }
  ]
}