{
  "openapi": "3.1.1",
  "info": {
    "title": "NovaFE.Service | public-v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.novafe.example"
    }
  ],
  "paths": {
    "/api/v1/certificates": {
      "post": {
        "tags": ["Certificates"],
        "summary": "Carga un certificado digital",
        "description": "Sube el .p12/.pfx (multipart/form-data: file, password). El mismo certificado sirve para todos los ambientes.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "File": {
                    "$ref": "#/components/schemas/IFormFile"
                  },
                  "Password": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "get": {
        "tags": ["Certificates"],
        "summary": "Lista los certificados digitales",
        "description": "Devuelve los certificados del contribuyente.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/certificates/{id}": {
      "get": {
        "tags": ["Certificates"],
        "summary": "Consulta un certificado digital",
        "description": "Devuelve los datos del certificado, como su vigencia y su estado.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/certificates/{id}/revoke": {
      "post": {
        "tags": ["Certificates"],
        "summary": "Revoca un certificado digital",
        "description": "El certificado deja de usarse para firmar comprobantes.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/dgii/connection": {
      "get": {
        "tags": ["Dgii"],
        "summary": "Verifica la conexión con la DGII",
        "description": "Comprueba que el contribuyente puede autenticarse ante la DGII en el\nambiente indicado. Fuerza el flujo semilla, firma y token si hace falta. No\ndevuelve el token.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "environment",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/ecf": {
      "post": {
        "tags": ["Ecf"],
        "summary": "Emite un comprobante fiscal electrónico",
        "description": "Header `Idempotency-Key` <b>obligatorio</b>, para reintento seguro.\nDevuelve `201` con el comprobante; `200` si la clave o el\n`internalNumber` ya se habían usado.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant` o `emisor`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IssueEcfCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IssueEcfCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IssueEcfCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDto"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "get": {
        "tags": ["Ecf"],
        "summary": "Lista los comprobantes emitidos",
        "description": "Listado paginado de comprobantes emitidos.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`, `emisor` o `consultor`.",
        "parameters": [
          {
            "name": "Type",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": ["integer", "string"],
              "format": "int32"
            }
          },
          {
            "name": "Status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "From",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "To",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "Environment",
            "in": "query",
            "description": "`test`, `cert` o `production`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Retrying",
            "in": "query",
            "description": "Solo los comprobantes en reintento automático (`true`) o solo los que no (`false`).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "MinAmount",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
              "type": ["number", "string"],
              "format": "double"
            }
          },
          {
            "name": "MaxAmount",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
              "type": ["number", "string"],
              "format": "double"
            }
          },
          {
            "name": "Sort",
            "in": "query",
            "description": "`issuedAt` (por defecto) o `montoTotal`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Order",
            "in": "query",
            "description": "`desc` (por defecto) o `asc`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "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"
            }
          },
          {
            "name": "Skip",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": ["integer", "string"],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfEcfSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfEcfSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfEcfSummaryDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/ecf/validate": {
      "post": {
        "tags": ["Ecf"],
        "summary": "Valida un comprobante sin emitirlo",
        "description": "Corre la misma matriz de validación\nestructural y fiscal por tipo (Módulo 2 + 6) que `POST /ecf`, pero no\nasigna una secuencia real, no firma y no persiste nada. Responde `200`\nsiempre que pueda evaluar el comprobante: `valid` dice si pasa,\n`errors` trae todos los problemas (no solo el primero), `warnings`\nlos avisos que no impiden emitir y `preview` los totales calculados y un\ne-NCF de muestra (nunca uno real), solo si es válido. Un cuerpo ilegible, una\npetición sin autenticar o un emisor sin perfil configurado siguen siendo\nerrores HTTP, porque ahí no hay nada que evaluar.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant` o `emisor`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IssueEcfCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IssueEcfCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IssueEcfCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidateEcfResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidateEcfResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidateEcfResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/ecf/{id}": {
      "get": {
        "tags": ["Ecf"],
        "summary": "Consulta un comprobante emitido",
        "description": "Devuelve el comprobante emitido y su estado.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`, `emisor` o `consultor`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/ecf/{id}/xml": {
      "get": {
        "tags": ["Ecf"],
        "summary": "Descarga el XML firmado de un comprobante",
        "description": "`?rfce=true` devuelve el `&lt;RFCE&gt;` (tipo 32 menor a DOP 250 mil).\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`, `emisor` o `consultor`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "rfce",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/ecf/{id}/representation": {
      "get": {
        "tags": ["Ecf"],
        "summary": "Descarga la representación impresa en PDF",
        "description": "`?layout=letter` o `pos`; si se\nomite, rige el formato por defecto del contribuyente\n(`representation.default_layout`, que cae en Carta). `?download=true`\nla descarga en vez de abrirla en el navegador.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`, `emisor` o `consultor`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "layout",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/RepresentationLayout"
            }
          },
          {
            "name": "download",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {}
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/ecf/{id}/retry": {
      "post": {
        "tags": ["Ecf"],
        "summary": "Reintenta el envío de un comprobante a la DGII",
        "description": "Reencola el envío a la DGII de un comprobante en estado `failed` o\n`review`, o `rejected` cuando la DGII dejó libre el e-NCF\n(`dgii.sequenceUsed = false`). Reenvía el mismo XML ya firmado. Si la DGII\nconsumió el número responde `409`: hay que emitir un comprobante nuevo.\nDevuelve `202` con el comprobante de vuelta en `signed`; el worker\nretoma el envío.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant` o `emisor`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/ecf/{id}/trackids": {
      "get": {
        "tags": ["Ecf"],
        "summary": "Consulta los trackIds de un comprobante en la DGII",
        "description": "Los trackIds que la DGII tiene registrados para este comprobante. Puede\nhaber más de uno si se remitió varias veces. No disponible en ambiente\nCerteCF.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`, `emisor` o `consultor`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DgiiTrackIdEntry"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DgiiTrackIdEntry"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DgiiTrackIdEntry"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/ecf/{id}/attempts": {
      "get": {
        "tags": ["Ecf"],
        "summary": "Historial de envíos de un comprobante",
        "description": "Un renglón por cada resultado de un ciclo contra la DGII (aceptado,\naceptado condicional, rechazado, en revisión o fallido), del más antiguo al\nmás reciente. Conserva lo anterior a un reenvío, que el comprobante ya no\nmuestra.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`, `emisor` o `consultor`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EcfAttemptDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EcfAttemptDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EcfAttemptDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/emitter-profile": {
      "get": {
        "tags": ["EmitterProfile"],
        "summary": "Consulta el perfil fiscal del emisor",
        "description": "Devuelve la dirección, ubicación y teléfonos del emisor del tenant actual.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmitterProfileDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmitterProfileDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmitterProfileDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "put": {
        "tags": ["EmitterProfile"],
        "summary": "Actualiza el perfil fiscal del emisor",
        "description": "Actualiza el perfil existente; no crea uno nuevo.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEmitterProfileCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEmitterProfileCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEmitterProfileCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmitterProfileDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmitterProfileDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmitterProfileDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/finance/summary": {
      "get": {
        "tags": ["Finance"],
        "summary": "Consulta el resumen fiscal de un período",
        "description": "Resumen fiscal entre from y to (inclusive), por fecha de emisión.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`, `emisor` o `consultor`.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FiscalSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiscalSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiscalSummaryDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/{tenantid}/fe/autenticacion/api/semilla": {
      "get": {
        "tags": ["InboundEcf"],
        "summary": "Obtiene la semilla de autenticación",
        "description": "Ruta `GET /{tenantid}/fe/autenticacion/api/semilla`. Es opcional (RF-05.3).\n\n**Autenticación:** esta ruta no lleva API key. La firma del documento y, si el contribuyente lo exige, un token Bearer identifican al llamante.",
        "parameters": [
          {
            "name": "tenantid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/xml": {}
            }
          }
        },
        "security": []
      }
    },
    "/{tenantid}/fe/autenticacion/api/validacioncertificado": {
      "post": {
        "tags": ["InboundEcf"],
        "summary": "Valida el certificado de un emisor externo",
        "description": "Ruta `POST /{tenantid}/fe/autenticacion/api/validacioncertificado`.\nEs opcional (RF-05.3). Devuelve `{ token, expira, expedido }`.\n\n**Autenticación:** esta ruta no lleva API key. La firma del documento y, si el contribuyente lo exige, un token Bearer identifican al llamante.",
        "parameters": [
          {
            "name": "tenantid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": []
      }
    },
    "/{tenantid}/fe/recepcion/api/ecf": {
      "post": {
        "tags": ["InboundEcf"],
        "summary": "Recibe un e-CF de otro contribuyente",
        "description": "Ruta `POST /{tenantid}/fe/recepcion/api/ecf`. Es obligatorio (RF-05.2).\nDevuelve el `&lt;ARECF&gt;` firmado en el cuerpo, síncronamente\n(`200`), tanto si el e-CF se recibió como si no (la razón va en el\npropio ARECF). Un `400` sin cuerpo significa que ni eso se pudo\nconstruir (XML irreconocible, tenant no usable, o sin certificado con el\nque firmar); un `401` significa que el tenant exige Bearer\n(`InboundEcfSettings.RequireBearerAuth`) y no vino uno vigente.\n\n**Autenticación:** esta ruta no lleva API key. La firma del documento y, si el contribuyente lo exige, un token Bearer identifican al llamante.",
        "parameters": [
          {
            "name": "tenantid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/xml": {}
            }
          }
        },
        "security": []
      }
    },
    "/{tenantid}/fe/aprobacioncomercial/api/ecf": {
      "post": {
        "tags": ["InboundEcf"],
        "summary": "Recibe la aprobación comercial de un comprador externo",
        "description": "Ruta `POST /{tenantid}/fe/aprobacioncomercial/api/ecf`. Es obligatorio\n(RF-05.5): un comprador externo envía su ACECF sobre un e-CF\n<b>propio</b>. Solo registra la decisión; responde `200` sin cuerpo o\n`400` plano (el ACECF no tiene un acuse como el ARECF). No debe\nconfundirse con el ACECF <b>saliente</b>, cuando el propio tenant decide\nsobre un comprobante que <b>recibió</b>: eso va por\n`POST /api/v1/received-ecf/{id}/commercial-approval`.\n\n**Autenticación:** esta ruta no lleva API key. La firma del documento y, si el contribuyente lo exige, un token Bearer identifican al llamante.",
        "parameters": [
          {
            "name": "tenantid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": []
      }
    },
    "/api/v1/inbound-ecf-settings": {
      "get": {
        "tags": ["InboundEcfSettings"],
        "summary": "Consulta la configuración de recepción B2B",
        "description": "**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InboundEcfSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundEcfSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundEcfSettingsDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "put": {
        "tags": ["InboundEcfSettings"],
        "summary": "Actualiza la configuración de recepción B2B",
        "description": "**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInboundEcfSettingsCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInboundEcfSettingsCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInboundEcfSettingsCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InboundEcfSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundEcfSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundEcfSettingsDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/organizations/{id}/tenants": {
      "post": {
        "tags": ["Organizations"],
        "summary": "Crea un tenant dentro de la organización",
        "description": "Crea un tenant nuevo y lo asigna a la organización en el mismo paso\n(self-serve): lo hace el `owner`/`admin` de la organización,\nsujeto al tope de tenants del plan. Para asociar un tenant\n<b>preexistente</b> (huérfano o de otra organización) sigue existiendo\nTask&lt;IActionResult&gt; OrganizationsController.AssignTenant(Guid id, Guid tenantId, CancellationToken ct), reservado al operador.\n\n**Autenticación:** requiere una API key válida (header `X-API-Key`).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterOrganizationTenantBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterOrganizationTenantBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterOrganizationTenantBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "get": {
        "tags": ["Organizations"],
        "summary": "Lista los tenants de la organización",
        "description": "Los contribuyentes (tenants) de la organización. Self-service para cualquier miembro (o el operador).\n\n**Autenticación:** requiere una API key válida (header `X-API-Key`).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "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": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfOrganizationTenantSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfOrganizationTenantSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfOrganizationTenantSummaryDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/plans": {
      "get": {
        "tags": ["Plans"],
        "summary": "Lista los planes comerciales",
        "description": "El catálogo de planes. Está disponible para cualquier usuario autenticado,\nno solo para el operador: el contribuyente lo necesita para elegir a qué\nnivel pedir un upgrade. Los planes ocultos (`isPublic: false`) solo los\nve el operador.\n\n**Autenticación:** requiere una API key válida (header `X-API-Key`).",
        "parameters": [
          {
            "name": "activeOnly",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PlanDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PlanDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PlanDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/received-ecf": {
      "get": {
        "tags": ["ReceivedEcf"],
        "summary": "Lista los e-CF recibidos",
        "description": "Listado paginado de los comprobantes que otros contribuyentes te han enviado.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`, `emisor` o `consultor`.",
        "parameters": [
          {
            "name": "Status",
            "in": "query",
            "description": "`Received` o `NotReceived`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Decision",
            "in": "query",
            "description": "`pending` (recibido, de un tipo que admite aprobación comercial y sin decisión), `accepted`\n        o `rejected`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Search",
            "in": "query",
            "description": "Texto en el e-NCF, el RNC del emisor o su nombre.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Type",
            "in": "query",
            "description": "Código del tipo de comprobante (31, 33, 34...).",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": ["integer", "string"],
              "format": "int32"
            }
          },
          {
            "name": "From",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "To",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "Environment",
            "in": "query",
            "description": "`test`, `cert` o `production`. Sin valor: todos.",
            "schema": {
              "type": "string"
            }
          },
          {
            "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"
            }
          },
          {
            "name": "Skip",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": ["integer", "string"],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfReceivedEcfDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfReceivedEcfDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfReceivedEcfDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/received-ecf/{id}": {
      "get": {
        "tags": ["ReceivedEcf"],
        "summary": "Consulta un e-CF recibido",
        "description": "Devuelve el resultado de la recepción y, si existe, la aprobación comercial.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`, `emisor` o `consultor`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReceivedEcfDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceivedEcfDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceivedEcfDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/received-ecf/{id}/commercial-approval": {
      "post": {
        "tags": ["ReceivedEcf"],
        "summary": "Aprueba o rechaza un e-CF recibido",
        "description": "Aprueba o rechaza comercialmente un e-CF recibido (RF-05.5). Arma y\nfirma el ACECF y encola su entrega al emisor externo y a la DGII\n(asíncrono: a diferencia del ARECF, no hay mandato de respuesta síncrona).\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant` o `emisor`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitCommercialApprovalBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitCommercialApprovalBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitCommercialApprovalBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/sequences": {
      "post": {
        "tags": ["Sequences"],
        "summary": "Registra un rango de e-NCF",
        "description": "Registra un rango de e-NCF autorizado por la DGII.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterSequenceRangeCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterSequenceRangeCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterSequenceRangeCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "get": {
        "tags": ["Sequences"],
        "summary": "Lista los rangos de e-NCF",
        "description": "**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NcfSequenceDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NcfSequenceDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NcfSequenceDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/sequences/{id}": {
      "get": {
        "tags": ["Sequences"],
        "summary": "Consulta un rango de e-NCF",
        "description": "**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NcfSequenceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NcfSequenceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NcfSequenceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/sequences/allocate": {
      "post": {
        "tags": ["Sequences"],
        "summary": "Toma el siguiente e-NCF disponible",
        "description": "Toma la siguiente secuencia disponible para un tipo y ambiente.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AllocateNcfCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AllocateNcfCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AllocateNcfCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AllocatedNcfDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AllocatedNcfDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AllocatedNcfDto"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/sequences/{id}/deactivate": {
      "post": {
        "tags": ["Sequences"],
        "summary": "Desactiva un rango de e-NCF",
        "description": "Se usa típicamente con un rango agotado, para poder registrar uno nuevo\ncon la misma serie (no puede haber dos rangos activos de la misma\nserie, tipo y ambiente a la vez).\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/sequences/annulments": {
      "post": {
        "tags": ["Sequences"],
        "summary": "Anula rangos de e-NCF sin usar",
        "description": "Anula la cola sin usar de uno o más rangos autorizados (ANECF).\nDescarta los números localmente de inmediato y confirma con la DGII dentro\nde la misma petición; si la DGII no responde, la anulación queda\n`failed` y se reintenta con Task&lt;IActionResult&gt; SequencesController.RetryAnnulment(Guid id, CancellationToken ct).\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestAnnulmentCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestAnnulmentCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RequestAnnulmentCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NcfAnnulmentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NcfAnnulmentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NcfAnnulmentDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "get": {
        "tags": ["Sequences"],
        "summary": "Lista las anulaciones de e-NCF",
        "description": "**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NcfAnnulmentDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NcfAnnulmentDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NcfAnnulmentDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/sequences/annulments/{id}": {
      "get": {
        "tags": ["Sequences"],
        "summary": "Consulta una anulación de e-NCF",
        "description": "**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NcfAnnulmentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NcfAnnulmentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NcfAnnulmentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/sequences/annulments/{id}/retry": {
      "post": {
        "tags": ["Sequences"],
        "summary": "Reintenta una anulación fallida",
        "description": "Reintenta el envío a la DGII de una anulación en estado `failed`.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NcfAnnulmentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NcfAnnulmentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NcfAnnulmentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/webhooks": {
      "post": {
        "tags": ["Webhooks"],
        "summary": "Registra un endpoint de webhook",
        "description": "La respuesta incluye el `secret`, que solo se muestra esta vez.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointCreatedDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointCreatedDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointCreatedDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "get": {
        "tags": ["Webhooks"],
        "summary": "Lista los endpoints de webhook",
        "description": "Devuelve los endpoints registrados por el contribuyente, sin sus secretos.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookEndpointDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookEndpointDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookEndpointDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/webhooks/{id}": {
      "get": {
        "tags": ["Webhooks"],
        "summary": "Consulta un endpoint de webhook",
        "description": "Devuelve la configuración del endpoint, sin su secreto.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "patch": {
        "tags": ["Webhooks"],
        "summary": "Actualiza un endpoint de webhook",
        "description": "Actualización parcial: un campo omitido no cambia; `description: \"\"` la borra.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "delete": {
        "tags": ["Webhooks"],
        "summary": "Elimina un endpoint de webhook",
        "description": "El endpoint deja de recibir eventos de inmediato.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/webhooks/{id}/rotate-secret": {
      "post": {
        "tags": ["Webhooks"],
        "summary": "Rota el secreto de un endpoint de webhook",
        "description": "Genera un secreto nuevo y lo devuelve en la respuesta, que es la única vez que se muestra.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/webhooks/{id}/ping": {
      "post": {
        "tags": ["Webhooks"],
        "summary": "Envía un evento de prueba a un endpoint",
        "description": "Envía un `webhook.ping` al endpoint y devuelve el resultado de la entrega.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookPingResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookPingResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookPingResultDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/webhooks/{id}/deliveries": {
      "get": {
        "tags": ["Webhooks"],
        "summary": "Lista las entregas de un endpoint",
        "description": "Log de entregas del endpoint, paginado (más reciente primero).\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": ["integer", "string"],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": ["integer", "string"],
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfWebhookDeliveryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfWebhookDeliveryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfWebhookDeliveryDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/v1/webhooks/{id}/deliveries/{deliveryid}/retry": {
      "post": {
        "tags": ["Webhooks"],
        "summary": "Reintenta una entrega fallida",
        "description": "Reintenta manualmente una entrega `dead`: vuelve a `pending`,\nlista de inmediato, con intentos y backoff en cero. La escalera\nautomática solo reanuda si vuelve a fallar.\n\n**Autenticación:** requiere una API key (header `X-API-Key`) con rol `admin_tenant`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "deliveryid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AllocatedNcfDto": {
        "required": ["encf", "type", "series", "sequential"],
        "type": "object",
        "properties": {
          "encf": {
            "type": "string"
          },
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "series": {
            "type": "string"
          },
          "sequential": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          }
        },
        "description": "La secuencia entregada, ya lista para armar el e-CF."
      },
      "AllocateNcfCommand": {
        "required": ["environment", "type"],
        "type": "object",
        "properties": {
          "environment": {
            "type": "string"
          },
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          }
        },
        "description": "Toma la siguiente secuencia e-NCF del inventario del contribuyente para un tipo\ny ambiente. Es una operación con efecto: avanza el puntero del rango."
      },
      "AnnulmentLineInput": {
        "required": ["type", "series", "rangeFrom", "rangeTo"],
        "type": "object",
        "properties": {
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "series": {
            "type": "string"
          },
          "rangeFrom": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          },
          "rangeTo": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          }
        },
        "description": "Una línea del request: el rango a anular de un tipo/serie puntual."
      },
      "CreateWebhookEndpointRequest": {
        "required": ["url", "events", "description"],
        "type": "object",
        "properties": {
          "url": {
            "type": ["null", "string"]
          },
          "events": {
            "type": ["null", "array"],
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": ["null", "string"]
          }
        }
      },
      "DgiiMessage": {
        "required": ["code", "value"],
        "type": "object",
        "properties": {
          "code": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "DgiiTrackIdEntry": {
        "required": ["trackId", "estado", "fechaRecepcion"],
        "type": "object",
        "properties": {
          "trackId": {
            "type": "string"
          },
          "estado": {
            "type": "string"
          },
          "fechaRecepcion": {
            "type": ["null", "string"],
            "format": "date-time"
          }
        },
        "description": "Una entrada de `/{amb}/consultatrackids/api/trackids/consulta`. Puede haber\nmás de una para el mismo e-NCF si se remitió varias veces."
      },
      "EcfAdditionalInfoPayload": {
        "type": "object",
        "properties": {
          "issuer": {
            "type": ["null", "string"]
          },
          "buyer": {
            "type": ["null", "string"]
          }
        },
        "description": "Texto libre para la Representación Impresa."
      },
      "EcfAdditionalTaxPayload": {
        "required": ["code"],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "rate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double",
            "default": 0
          },
          "iscEspecifico": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double",
            "default": 0
          },
          "iscAdvalorem": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double",
            "default": 0
          },
          "otros": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double",
            "default": 0
          }
        },
        "description": "Desglose de impuestos adicionales por código de la Tabla I (001–039). Todos los\nmontos los trae el cliente ya calculados. `iscEspecifico` (monto fijo por\nvolumen: alcoholes 006-018, cigarrillos 019-022) <b>integra la base imponible\ndel ITBIS</b> de esa línea; `iscAdvalorem` y `otros` (Propina, CDT, ISC\nde servicios, Primera Placa…) van \"por encima\", sin tocar la base."
      },
      "EcfAttemptDto": {
        "required": [
          "attempt",
          "outcome",
          "trackId",
          "statusCode",
          "statusText",
          "sequenceUsed",
          "messages",
          "retryDecision",
          "xmlSha256",
          "recordedAt"
        ],
        "type": "object",
        "properties": {
          "attempt": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "description": "1, 2, 3… dentro del comprobante.",
            "format": "int32"
          },
          "outcome": {
            "type": "string",
            "description": "En qué estado dejó el ciclo al comprobante: `accepted`,\n`accepted_conditional`, `rejected`, `review` o `failed`."
          },
          "trackId": {
            "type": ["null", "string"],
            "description": "`TrackId` de la DGII de este ciclo; ausente si no llegó a haber uno."
          },
          "statusCode": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "description": "Código de estado de la DGII (1 aceptado, 2 rechazado, 4 aceptado condicional); ausente si no hubo veredicto.",
            "format": "int32"
          },
          "statusText": {
            "type": ["null", "string"],
            "description": "El `estado` textual de la DGII."
          },
          "sequenceUsed": {
            "type": ["null", "boolean"],
            "description": "`secuenciaUtilizada` de la DGII: `false` = el e-NCF no se consumió;\n        `true` o ausente = consumido."
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DgiiMessage"
            },
            "description": "Observaciones o motivo de rechazo de la DGII; o el motivo del fallo si no hubo veredicto."
          },
          "retryDecision": {
            "type": ["null", "string"],
            "description": "Qué se decidió con un rechazo: `auto:&lt;código&gt;` (la DGII falló de forma\ntransitoria y NovaFE reenvía el mismo XML solo, p. ej. `auto:4`) o\n`exhausted` (era reintentable pero se agotó el ladder y el rechazo quedó\nfirme). Ausente en el resto de resultados."
          },
          "xmlSha256": {
            "type": "string",
            "description": "SHA-256 (hex) del XML enviado en este ciclo."
          },
          "recordedAt": {
            "type": "string",
            "description": "Cuándo se registró el resultado.",
            "format": "date-time"
          }
        },
        "description": "Un renglón del historial de envíos de un comprobante: cómo terminó un ciclo\ncontra la DGII. Lo que emite `GET /api/v1/ecf/{id}/attempts`."
      },
      "EcfBuyerPayload": {
        "type": "object",
        "properties": {
          "name": {
            "type": ["null", "string"]
          },
          "rnc": {
            "type": ["null", "string"]
          },
          "foreignId": {
            "type": ["null", "string"]
          },
          "email": {
            "type": ["null", "string"]
          },
          "contact": {
            "type": ["null", "string"]
          },
          "address": {
            "type": ["null", "string"]
          },
          "municipality": {
            "type": ["null", "string"]
          },
          "province": {
            "type": ["null", "string"]
          },
          "additionalInfo": {
            "type": ["null", "string"]
          }
        },
        "description": "Bloque `&lt;Comprador&gt;`. `Rnc` y `ForeignId` son excluyentes."
      },
      "EcfDeclaredTotalsPayload": {
        "type": "object",
        "properties": {
          "montoGravadoTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoExento": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "totalItbis": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoImpuestoAdicional": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          }
        },
        "description": "Totales que calculó el cliente (en DOP). Se comparan con el cálculo de NovaFE\n(tolerancia RF-06.6); el valor de NovaFE es el que va al XML. Todo opcional."
      },
      "EcfDgiiExchange": {
        "required": [
          "trackId",
          "status",
          "statusCode",
          "sequenceUsed",
          "messages",
          "submittedAt",
          "receivedAt",
          "processedAt"
        ],
        "type": "object",
        "properties": {
          "trackId": {
            "type": ["null", "string"],
            "description": "Identificador que la DGII asigna al recibir el comprobante."
          },
          "status": {
            "type": ["null", "string"],
            "description": "El `estado` textual de la DGII (\"Aceptado\", \"Rechazado\", \"En Proceso\"…); en el idioma en que lo manda ella."
          },
          "statusCode": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "description": "Código de estado de la DGII: 1 aceptado · 2 rechazado · 3 en proceso · 4 aceptado condicional.",
            "format": "int32"
          },
          "sequenceUsed": {
            "type": ["null", "boolean"],
            "description": "`secuenciaUtilizada` de la DGII: `false` = el e-NCF no se consumió\n        (firma/XML inválidos); `true` o ausente = consumido."
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DgiiMessage"
            },
            "description": "Observaciones o motivo de rechazo que devolvió la DGII."
          },
          "submittedAt": {
            "type": ["null", "string"],
            "description": "Instante en que la DGII confirmó la recepción (hay string? EcfDgiiExchange.TrackId).",
            "format": "date-time"
          },
          "receivedAt": {
            "type": ["null", "string"],
            "description": "La `fechaRecepcion` que informó la DGII; ausente si no la dio (p. ej. RFCE).",
            "format": "date-time"
          },
          "processedAt": {
            "type": ["null", "string"],
            "description": "Instante en que la DGII dio un resultado definitivo.",
            "format": "date-time"
          }
        },
        "description": "El intercambio con la DGII de un comprobante: lo que ella respondió más los\ninstantes en que NovaFE registró cada paso."
      },
      "EcfDto": {
        "required": [
          "id",
          "status",
          "encf",
          "type",
          "environment",
          "sequenceExpiresOn",
          "issueDate",
          "issuedAt",
          "signedAt",
          "securityCode",
          "qrUrl",
          "submitsRfce",
          "internalNumber",
          "toleranceWarning",
          "signedDuringContingency",
          "montoTotal",
          "buyerRnc",
          "buyerName",
          "documentHash"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "encf": {
            "type": "string"
          },
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "environment": {
            "type": "string"
          },
          "sequenceExpiresOn": {
            "type": ["null", "string"],
            "format": "date"
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time"
          },
          "signedAt": {
            "type": "string",
            "format": "date-time"
          },
          "securityCode": {
            "type": "string"
          },
          "qrUrl": {
            "type": "string"
          },
          "submitsRfce": {
            "type": "boolean"
          },
          "internalNumber": {
            "type": ["null", "string"]
          },
          "toleranceWarning": {
            "type": ["null", "string"]
          },
          "signedDuringContingency": {
            "type": "boolean"
          },
          "montoTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "buyerRnc": {
            "type": ["null", "string"]
          },
          "buyerName": {
            "type": ["null", "string"]
          },
          "documentHash": {
            "type": "string"
          },
          "dgii": {
            "description": "Lo que pasó con la DGII: `trackId`, estado (texto y código), mensajes,\n`secuenciaUtilizada` y los instantes de envío, recepción y resolución.\n`null` mientras el comprobante no se haya enviado.",
            "$ref": "#/components/schemas/EcfDgiiExchange"
          },
          "retry": {
            "description": "El reintento automático en curso o ya hecho: cuántas veces NovaFE reenvió el mismo\ncomprobante tras un rechazo transitorio de la DGII, el tope, y cuándo es el próximo\nintento. `null` mientras no haya habido ningún reintento.",
            "$ref": "#/components/schemas/EcfRetry"
          },
          "links": {
            "description": "Enlaces a los recursos relacionados del comprobante.",
            "$ref": "#/components/schemas/EcfLinks"
          }
        },
        "description": "Vista de un comprobante emitido (respuesta de `POST /ecf` y `GET /ecf/{id}`).\nTrae la identidad fiscal, el resumen comercial (comprador, monto total —\nigual que EcfSummaryDto) y el resultado del intercambio con\nla DGII (EcfDgiiExchange? EcfDto.Dgii). El desglose por línea y el resto del detalle\ncomercial siguen viviendo solo en el XML firmado (`GET /ecf/{id}/xml`)."
      },
      "EcfExportPayload": {
        "type": "object",
        "properties": {
          "loadingPortName": {
            "type": ["null", "string"]
          },
          "deliveryTerms": {
            "type": ["null", "string"]
          },
          "totalFob": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "insurance": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "freight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "otherCharges": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "totalCif": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "customsRegime": {
            "type": ["null", "string"]
          },
          "departurePortName": {
            "type": ["null", "string"]
          },
          "unloadingPortName": {
            "type": ["null", "string"]
          }
        },
        "description": "Datos de exportación (solo tipo 46)."
      },
      "EcfForeignCurrencyPayload": {
        "required": ["currency", "exchangeRate", "totals"],
        "type": "object",
        "properties": {
          "currency": {
            "type": "string"
          },
          "exchangeRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "totals": {
            "$ref": "#/components/schemas/EcfForeignCurrencyTotalsPayload"
          }
        },
        "description": "Facturación en divisa (`&lt;OtraMoneda&gt;`). El cliente trae los montos ya convertidos."
      },
      "EcfForeignCurrencyTotalsPayload": {
        "type": "object",
        "properties": {
          "montoGravadoTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoGravadoI1": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoGravadoI2": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoGravadoI3": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoExento": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "totalItbis": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "totalItbis1": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "totalItbis2": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "totalItbis3": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          }
        }
      },
      "EcfGlobalAdjustmentPayload": {
        "required": ["line"],
        "type": "object",
        "properties": {
          "line": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "kind": {
            "type": "string",
            "default": "discount"
          },
          "affectsItbisRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32",
            "default": 1
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double",
            "default": 0
          },
          "norm1007": {
            "type": "boolean",
            "default": false
          },
          "description": {
            "type": ["null", "string"]
          },
          "percentage": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          }
        },
        "description": "Un descuento o recargo global (Sección D)."
      },
      "EcfItemCodePayload": {
        "required": ["type", "value"],
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "EcfLineDetailsPayload": {
        "type": "object",
        "properties": {
          "referenceQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "referenceUnit": {
            "type": ["null", "string"]
          },
          "subquantities": {
            "type": ["null", "array"],
            "items": {
              "$ref": "#/components/schemas/EcfSubquantityPayload"
            }
          },
          "alcoholDegrees": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "referenceUnitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "manufactureDate": {
            "type": ["null", "string"],
            "format": "date"
          },
          "expiryDate": {
            "type": ["null", "string"],
            "format": "date"
          },
          "mining": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EcfMiningPayload"
              }
            ]
          }
        },
        "description": "Campos opcionales del `&lt;Item&gt;` — passthrough. La <b>derivación</b> del\nISC desde `alcoholDegrees`/`referenceQuantity` es un slice posterior;\nhoy el cliente trae el monto final del ISC en `additionalTaxes` (el ISC\nespecífico ahí sí integra la base del ITBIS — ver EcfAdditionalTaxPayload)."
      },
      "EcfLineForeignCurrencyPayload": {
        "type": "object",
        "properties": {
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "discount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "surcharge": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "lineAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          }
        },
        "description": "`&lt;OtraMonedaDetalle&gt;` — precio y montos de la línea en divisa (passthrough)."
      },
      "EcfLinePayload": {
        "required": ["name"],
        "type": "object",
        "properties": {
          "name": {
            "type": ["null", "string"]
          },
          "kind": {
            "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"
          },
          "itbisRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "format": "int32"
          },
          "unitOfMeasure": {
            "type": ["null", "string"]
          },
          "description": {
            "type": ["null", "string"]
          },
          "discount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double",
            "default": 0
          },
          "surcharge": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double",
            "default": 0
          },
          "priceIncludesTax": {
            "type": ["null", "boolean"]
          },
          "declaredAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "codes": {
            "type": ["null", "array"],
            "items": {
              "$ref": "#/components/schemas/EcfItemCodePayload"
            }
          },
          "retention": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EcfLineRetentionPayload"
              }
            ]
          },
          "additionalTaxes": {
            "type": ["null", "array"],
            "items": {
              "$ref": "#/components/schemas/EcfAdditionalTaxPayload"
            }
          },
          "foreignCurrency": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EcfLineForeignCurrencyPayload"
              }
            ]
          },
          "details": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EcfLineDetailsPayload"
              }
            ]
          }
        },
        "description": "Una línea de `&lt;DetallesItems&gt;`."
      },
      "EcfLineRetentionPayload": {
        "type": "object",
        "properties": {
          "agent": {
            "type": "string",
            "default": "withholding"
          },
          "itbisWithheld": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double",
            "default": 0
          },
          "isrWithheld": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double",
            "default": 0
          }
        },
        "description": "Área `&lt;Retencion&gt;` de la línea (tipos 41 y 47). Los montos los calcula el cliente."
      },
      "EcfLinks": {
        "required": ["self", "xml", "rfceXml", "representation"],
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "description": "El comprobante y su estado."
          },
          "xml": {
            "type": "string",
            "description": "El XML firmado (`&lt;ECF&gt;`)."
          },
          "rfceXml": {
            "type": ["null", "string"],
            "description": "El resumen firmado (`&lt;RFCE&gt;`); solo cuando `submitsRfce`."
          },
          "representation": {
            "type": "string",
            "description": "La Representación Impresa en PDF."
          }
        },
        "description": "Enlaces (relativos) a los recursos del comprobante."
      },
      "EcfMiningPayload": {
        "type": "object",
        "properties": {
          "netWeightKilogram": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "netWeightMining": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "affiliationType": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "format": "int32"
          },
          "settlement": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "format": "int32"
          }
        },
        "description": "`&lt;Mineria&gt;` — datos de liquidación minera (solo tipos 32/33/34/46)."
      },
      "EcfPagePayload": {
        "type": "object",
        "properties": {
          "number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "format": "int32"
          },
          "lineFrom": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "format": "int32"
          },
          "lineTo": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "format": "int32"
          },
          "montoGravadoTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoGravadoI1": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoGravadoI2": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoGravadoI3": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoExento": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "totalItbis": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "itbis1": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "itbis2": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "itbis3": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoImpuestoAdicional": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "iscEspecifico": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "otrosImpuestos": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "nonInvoiceableAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          }
        },
        "description": "Página de la RI (`&lt;Paginacion&gt;`)."
      },
      "EcfPaymentMethodPayload": {
        "required": ["type", "amount"],
        "type": "object",
        "properties": {
          "type": {
            "type": ["null", "string"]
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          }
        },
        "description": "Una forma de pago. `Type` y `Amount` son nullable para distinguir \"no vino\" de un\nvalor: el validador exige ambos y la API nunca rellena uno por su cuenta."
      },
      "EcfPaymentPayload": {
        "type": "object",
        "properties": {
          "condition": {
            "type": ["null", "string"]
          },
          "dueDate": {
            "type": ["null", "string"],
            "format": "date"
          },
          "methods": {
            "type": ["null", "array"],
            "items": {
              "$ref": "#/components/schemas/EcfPaymentMethodPayload"
            }
          }
        },
        "description": "Bloque de pago del encabezado."
      },
      "EcfReferencePayload": {
        "required": ["modifiedNcf", "modifiedNcfDate"],
        "type": "object",
        "properties": {
          "modifiedNcf": {
            "type": "string"
          },
          "modifiedNcfDate": {
            "type": "string",
            "format": "date"
          },
          "modificationCode": {
            "type": ["null", "string"]
          },
          "otherIssuerRnc": {
            "type": ["null", "string"]
          }
        },
        "description": "Sección `&lt;InformacionReferencia&gt;` — Notas de Crédito/Débito y reemplazos."
      },
      "EcfRetry": {
        "required": ["count", "max", "nextAttemptAt"],
        "type": "object",
        "properties": {
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "description": "Reenvíos automáticos que NovaFE ya hizo de este comprobante.",
            "format": "int32"
          },
          "max": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "description": "Tope de reenvíos automáticos. Al agotarse, el rechazo queda firme.",
            "format": "int32"
          },
          "nextAttemptAt": {
            "type": ["null", "string"],
            "description": "Cuándo es el próximo intento; `null` si no hay uno pendiente.",
            "format": "date-time"
          }
        },
        "description": "Reintento automático de un comprobante tras un rechazo transitorio de la DGII."
      },
      "EcfShippingPayload": {
        "type": "object",
        "properties": {
          "shipmentDate": {
            "type": ["null", "string"],
            "format": "date"
          },
          "shipmentNumber": {
            "type": ["null", "string"]
          },
          "containerNumber": {
            "type": ["null", "string"]
          },
          "referenceNumber": {
            "type": ["null", "string"]
          },
          "grossWeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "netWeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "grossWeightUnit": {
            "type": ["null", "string"]
          },
          "netWeightUnit": {
            "type": ["null", "string"]
          },
          "packageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "packageUnit": {
            "type": ["null", "string"]
          },
          "volume": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "volumeUnit": {
            "type": ["null", "string"]
          },
          "export": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EcfExportPayload"
              }
            ]
          }
        },
        "description": "Datos de embarque (`&lt;InformacionesAdicionales&gt;`). Passthrough."
      },
      "EcfSubquantityPayload": {
        "required": ["quantity", "unitCode"],
        "type": "object",
        "properties": {
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "unitCode": {
            "type": "string"
          }
        }
      },
      "EcfSubtotalPayload": {
        "type": "object",
        "properties": {
          "number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "format": "int32"
          },
          "description": {
            "type": ["null", "string"]
          },
          "order": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "format": "int32"
          },
          "montoGravadoTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoGravadoI1": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoGravadoI2": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoGravadoI3": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "totalItbis": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "itbis1": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "itbis2": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "itbis3": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoImpuestoAdicional": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "montoExento": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "lines": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "format": "int32"
          }
        },
        "description": "Subtotal informativo para la RI (Sección C). No afecta la base imponible."
      },
      "EcfSummaryDto": {
        "required": [
          "id",
          "status",
          "encf",
          "type",
          "environment",
          "issueDate",
          "montoTotal",
          "buyerRnc",
          "buyerName",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "encf": {
            "type": "string"
          },
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "environment": {
            "type": "string"
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "montoTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "buyerRnc": {
            "type": ["null", "string"]
          },
          "buyerName": {
            "type": ["null", "string"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "retry": {
            "description": "Reintento automático (ver EcfRetry? EcfDto.Retry); `null` si no hubo ninguno.",
            "$ref": "#/components/schemas/EcfRetry"
          }
        },
        "description": "Fila del listado de comprobantes emitidos."
      },
      "EcfTransportPayload": {
        "type": "object",
        "properties": {
          "driver": {
            "type": ["null", "string"]
          },
          "transportDocument": {
            "type": ["null", "string"]
          },
          "vehicleId": {
            "type": ["null", "string"]
          },
          "plate": {
            "type": ["null", "string"]
          },
          "route": {
            "type": ["null", "string"]
          },
          "zone": {
            "type": ["null", "string"]
          },
          "deliveryNote": {
            "type": ["null", "string"]
          },
          "via": {
            "type": ["null", "string"]
          },
          "originCountry": {
            "type": ["null", "string"]
          },
          "destinationAddress": {
            "type": ["null", "string"]
          },
          "destinationCountry": {
            "type": ["null", "string"]
          },
          "carrierRnc": {
            "type": ["null", "string"]
          },
          "carrierName": {
            "type": ["null", "string"]
          },
          "voyageNumber": {
            "type": ["null", "string"]
          }
        },
        "description": "Datos de transporte (`&lt;Transporte&gt;`). Passthrough."
      },
      "EmitterProfileDto": {
        "required": [
          "id",
          "tenantId",
          "address",
          "municipality",
          "province",
          "phones",
          "email",
          "economicActivity",
          "defaultEnvironment",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "address": {
            "type": "string"
          },
          "municipality": {
            "type": ["null", "string"]
          },
          "province": {
            "type": ["null", "string"]
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "email": {
            "type": ["null", "string"]
          },
          "economicActivity": {
            "type": ["null", "string"]
          },
          "defaultEnvironment": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": ["null", "string"],
            "format": "date-time"
          }
        },
        "description": "Vista del perfil fiscal del emisor."
      },
      "FiscalSummaryByTypeDto": {
        "required": ["type", "typeName", "count", "totalAmount", "totalItbis"],
        "type": "object",
        "properties": {
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "typeName": {
            "type": "string"
          },
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "totalItbis": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          }
        },
        "description": "Totales de un tipo de e-CF puntual dentro del rango."
      },
      "FiscalSummaryDto": {
        "required": [
          "from",
          "to",
          "totalCount",
          "totalInvoiced",
          "totalItbis",
          "totalItbis1",
          "totalItbis2",
          "totalItbis3",
          "totalExempt",
          "totalItbisWithheld",
          "totalIsrWithheld",
          "totalCreditNoteAmount",
          "totalDebitNoteAmount",
          "netCreditDebitEffect",
          "byType"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "totalInvoiced": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "totalItbis": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "totalItbis1": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "totalItbis2": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "totalItbis3": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "totalExempt": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "totalItbisWithheld": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "totalIsrWithheld": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "totalCreditNoteAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "totalDebitNoteAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "netCreditDebitEffect": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "byType": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FiscalSummaryByTypeDto"
            }
          }
        },
        "description": "Resumen fiscal del lado ventas (lo que el contribuyente <b>emitió</b>) para un\nrango de fechas — visibilidad interna, no un formato de envío de la DGII\n(606/607/608): ese mapeo exacto queda para cuando se consiga el spec real.\nUn e-CF `rejected` no cuenta en ningún total: nunca quedó facturado\nante la DGII."
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "InboundEcfSettingsDto": {
        "required": ["requireBearerAuth"],
        "type": "object",
        "properties": {
          "requireBearerAuth": {
            "type": "boolean"
          }
        }
      },
      "IssueEcfCommand": {
        "required": ["type", "lines"],
        "type": "object",
        "properties": {
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "description": "Código DGII del tipo de e-CF: 31, 32, 33, 34, 41, 43, 44, 45, 46, 47.",
            "format": "int32",
            "default": 31
          },
          "encf": {
            "type": ["null", "string"],
            "description": "e-NCF de 13 caracteres. Solo con `sequences.mode = external` (y\nobligatorio ahí); con `managed` se rechaza, NovaFE asigna el suyo."
          },
          "sequenceExpiresOn": {
            "type": ["null", "string"],
            "description": "`&lt;FechaVencimientoSecuencia&gt;` del e-NCF. Con\n        `sequences.mode = external` es obligatorio en los tipos que llevan\n        vencimiento (todos menos 32 y 34) y no aplica en esos dos; en\n        `managed` se rechaza.",
            "format": "date"
          },
          "issueDate": {
            "type": ["null", "string"],
            "description": "Fecha de emisión (calendario dominicano). Default: hoy.",
            "format": "date"
          },
          "incomeType": {
            "type": ["null", "string"],
            "description": "`&lt;TipoIngresos&gt;` — \"01\"…\"06\". Obligatorio en 31/32/33/34/44/45/46."
          },
          "pricesIncludeTax": {
            "type": "boolean",
            "description": "`true` si los precios de las líneas ya traen el ITBIS incluido."
          },
          "deferredDelivery": {
            "type": "boolean",
            "description": "`&lt;IndicadorEnvioDiferido&gt;` — solo contribuyentes autorizados."
          },
          "nonInvoiceableAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "description": "`&lt;MontoNoFacturable&gt;` — reembolsos, propina voluntaria. Puede ser negativo.",
            "format": "double"
          },
          "internalNumber": {
            "type": ["null", "string"],
            "description": "`&lt;NumeroFacturaInterna&gt;` — clave de dedup de negocio."
          },
          "sellerCode": {
            "type": ["null", "string"],
            "description": "`&lt;CodigoVendedor&gt;`."
          },
          "additionalInfo": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EcfAdditionalInfoPayload"
              }
            ]
          },
          "buyer": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EcfBuyerPayload"
              }
            ]
          },
          "payment": {
            "$ref": "#/components/schemas/EcfPaymentPayload"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EcfLinePayload"
            }
          },
          "reference": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EcfReferencePayload"
              }
            ]
          },
          "globalAdjustments": {
            "type": ["null", "array"],
            "items": {
              "$ref": "#/components/schemas/EcfGlobalAdjustmentPayload"
            }
          },
          "foreignCurrency": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EcfForeignCurrencyPayload"
              }
            ]
          },
          "shipping": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EcfShippingPayload"
              }
            ]
          },
          "transport": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EcfTransportPayload"
              }
            ]
          },
          "subtotals": {
            "type": ["null", "array"],
            "items": {
              "$ref": "#/components/schemas/EcfSubtotalPayload"
            }
          },
          "pagination": {
            "type": ["null", "array"],
            "items": {
              "$ref": "#/components/schemas/EcfPagePayload"
            }
          },
          "declaredTotals": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Totales declarados por el cliente (chequeo de tolerancia; nunca bloquea).",
                "$ref": "#/components/schemas/EcfDeclaredTotalsPayload"
              }
            ]
          }
        },
        "description": "Payload de emisión de un e-CF (`POST /api/v1/ecf`). Un solo objeto\ndiscriminado por int IssueEcfCommand.Type; el servidor asigna la secuencia, arma el\nbloque Emisor desde el perfil del tenant, calcula los totales, firma y persiste."
      },
      "NcfAnnulmentDto": {
        "required": [
          "id",
          "environment",
          "reason",
          "status",
          "totalCount",
          "lines",
          "dgiiCode",
          "dgiiMessages",
          "lastError",
          "attempts",
          "submittedAt",
          "voidedAt",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "environment": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NcfAnnulmentLineDto"
            }
          },
          "dgiiCode": {
            "type": ["null", "string"]
          },
          "dgiiMessages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lastError": {
            "type": ["null", "string"]
          },
          "attempts": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "submittedAt": {
            "type": ["null", "string"],
            "format": "date-time"
          },
          "voidedAt": {
            "type": ["null", "string"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Lo que la API devuelve para una solicitud de anulación de rango (Módulo 8)."
      },
      "NcfAnnulmentLineDto": {
        "required": ["type", "series", "rangeFrom", "rangeTo", "count"],
        "type": "object",
        "properties": {
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "series": {
            "type": "string"
          },
          "rangeFrom": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          },
          "rangeTo": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          },
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          },
          "typeName": {
            "type": ["null", "string"],
            "description": "Nombre del tipo de comprobante de cara al contribuyente."
          }
        },
        "description": "Una línea (`&lt;Anulacion&gt;`) de la solicitud."
      },
      "NcfSequenceDto": {
        "required": [
          "id",
          "environment",
          "type",
          "series",
          "rangeFrom",
          "rangeTo",
          "next",
          "capacity",
          "remaining",
          "isLowStock",
          "expiresOn",
          "active",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "environment": {
            "type": "string"
          },
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "series": {
            "type": "string"
          },
          "rangeFrom": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          },
          "rangeTo": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          },
          "next": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          },
          "capacity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          },
          "remaining": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          },
          "isLowStock": {
            "type": "boolean"
          },
          "expiresOn": {
            "type": ["null", "string"],
            "format": "date"
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "typeName": {
            "type": ["null", "string"],
            "description": "Nombre del tipo de comprobante de cara al contribuyente."
          }
        },
        "description": "Lo que la API devuelve para un rango de secuencias. Los campos derivados\n(long NcfSequenceDto.Remaining, long NcfSequenceDto.Capacity, bool NcfSequenceDto.IsLowStock) los\ncalcula la consulta — bool NcfSequenceDto.IsLowStock con el setting runtime\n`sequences.low_stock_fraction` (RF-07.3); no se almacenan."
      },
      "OrganizationTenantSummaryDto": {
        "required": [
          "id",
          "rnc",
          "legalName",
          "status",
          "defaultEnvironment",
          "certificateExpiresAt",
          "lastEcfIssuedAt",
          "hasLogo"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "rnc": {
            "type": "string"
          },
          "legalName": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "defaultEnvironment": {
            "type": ["null", "string"]
          },
          "certificateExpiresAt": {
            "type": ["null", "string"],
            "format": "date-time"
          },
          "lastEcfIssuedAt": {
            "type": ["null", "string"],
            "format": "date-time"
          },
          "hasLogo": {
            "type": "boolean",
            "description": "Si tiene logo — así la card no dispara un `&lt;img&gt;` a un 404 cuando no hay ninguno."
          }
        },
        "description": "Row shape for a tenant as seen from its organization's tenant grid — the\nplain `TenantSummaryDto` (operator listing) plus what the grid needs\nto show at a glance, sin pegarle al backend una vez por tarjeta."
      },
      "PagedResultOfEcfSummaryDto": {
        "required": ["items", "totalCount", "page", "pageSize"],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EcfSummaryDto"
            }
          },
          "totalCount": {
            "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"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "hasNextPage": {
            "type": "boolean"
          },
          "hasPreviousPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfOrganizationTenantSummaryDto": {
        "required": ["items", "totalCount", "page", "pageSize"],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationTenantSummaryDto"
            }
          },
          "totalCount": {
            "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"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "hasNextPage": {
            "type": "boolean"
          },
          "hasPreviousPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfReceivedEcfDto": {
        "required": ["items", "totalCount", "page", "pageSize"],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReceivedEcfDto"
            }
          },
          "totalCount": {
            "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"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "hasNextPage": {
            "type": "boolean"
          },
          "hasPreviousPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfWebhookDeliveryDto": {
        "required": ["items", "totalCount", "page", "pageSize"],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryDto"
            }
          },
          "totalCount": {
            "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"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "hasNextPage": {
            "type": "boolean"
          },
          "hasPreviousPage": {
            "type": "boolean"
          }
        }
      },
      "PlanDto": {
        "required": [
          "id",
          "key",
          "displayName",
          "monthlyPriceDop",
          "annualPriceDop",
          "includedEcfPerPeriod",
          "overagePricePerEcfDop",
          "hardCap",
          "includedTenants",
          "tenantOveragePriceDop",
          "tenantHardCap",
          "includedMembers",
          "memberOveragePriceDop",
          "memberHardCap",
          "requestsPerMinute",
          "sortOrder",
          "active",
          "customPricing",
          "supportLabel",
          "slaLabel",
          "targetDescription",
          "isPublic",
          "paidEnvironmentsEnabled"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "monthlyPriceDop": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "annualPriceDop": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "includedEcfPerPeriod": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "overagePricePerEcfDop": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "hardCap": {
            "type": "boolean"
          },
          "includedTenants": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "tenantOveragePriceDop": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "tenantHardCap": {
            "type": "boolean"
          },
          "includedMembers": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "memberOveragePriceDop": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "memberHardCap": {
            "type": "boolean"
          },
          "requestsPerMinute": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "active": {
            "type": "boolean"
          },
          "customPricing": {
            "type": "boolean"
          },
          "supportLabel": {
            "type": ["null", "string"]
          },
          "slaLabel": {
            "type": ["null", "string"]
          },
          "targetDescription": {
            "type": ["null", "string"]
          },
          "isPublic": {
            "type": "boolean"
          },
          "paidEnvironmentsEnabled": {
            "type": "boolean"
          }
        },
        "description": "Un nivel del catálogo de planes."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": ["null", "string"]
          },
          "title": {
            "type": ["null", "string"]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "format": "int32"
          },
          "detail": {
            "type": ["null", "string"]
          },
          "instance": {
            "type": ["null", "string"]
          }
        }
      },
      "ReceivedEcfDto": {
        "required": [
          "id",
          "status",
          "noReceptionReason",
          "issuerRnc",
          "issuerName",
          "encf",
          "type",
          "issueDate",
          "montoTotal",
          "receivedAt",
          "commercialApprovalDecision",
          "commercialApprovalRejectionReason",
          "commercialApprovalDecidedAt",
          "commercialApprovalSentToIssuerAt",
          "commercialApprovalSentToDgiiAt",
          "commercialApprovalApplies"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "noReceptionReason": {
            "type": ["null", "string"]
          },
          "issuerRnc": {
            "type": "string"
          },
          "issuerName": {
            "type": ["null", "string"]
          },
          "encf": {
            "type": "string"
          },
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "issueDate": {
            "type": ["null", "string"],
            "format": "date"
          },
          "montoTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["null", "number", "string"],
            "format": "double"
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time"
          },
          "commercialApprovalDecision": {
            "type": ["null", "string"]
          },
          "commercialApprovalRejectionReason": {
            "type": ["null", "string"]
          },
          "commercialApprovalDecidedAt": {
            "type": ["null", "string"],
            "format": "date-time"
          },
          "commercialApprovalSentToIssuerAt": {
            "type": ["null", "string"],
            "format": "date-time"
          },
          "commercialApprovalSentToDgiiAt": {
            "type": ["null", "string"],
            "format": "date-time"
          },
          "commercialApprovalApplies": {
            "type": "boolean"
          },
          "commercialApprovalAutomatic": {
            "type": "boolean",
            "default": false
          },
          "commercialApprovalAutomaticRule": {
            "type": ["null", "string"]
          }
        },
        "description": "Lo que la API y los webhooks exponen de un e-CF ajeno recibido (Módulo 5).\nCommercialApprovalApplies es `false` para los tipos que la DGII no admite en\nuna aprobación comercial (32, 41, 43, 46 y 47): nunca pueden quedar pendientes de decisión."
      },
      "RegisterOrganizationTenantBody": {
        "required": ["rnc", "legalName", "tradeName"],
        "type": "object",
        "properties": {
          "rnc": {
            "type": "string"
          },
          "legalName": {
            "type": "string"
          },
          "tradeName": {
            "type": ["null", "string"]
          }
        }
      },
      "RegisterSequenceRangeCommand": {
        "required": ["environment", "type", "series", "rangeFrom", "rangeTo"],
        "type": "object",
        "properties": {
          "environment": {
            "type": "string"
          },
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "series": {
            "type": "string"
          },
          "rangeFrom": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          },
          "rangeTo": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int64"
          },
          "expiresOn": {
            "type": ["null", "string"],
            "format": "date"
          }
        },
        "description": "Registra un rango de e-NCF autorizado por la DGII para el contribuyente actual.\nExpiresOn es el vencimiento que figura en la autorización de\nla DGII: obligatorio en los tipos que llevan vencimiento de secuencia y no\naplica en los tipos 32 y 34. Nunca se deriva ni se asume."
      },
      "RepresentationLayout": {
        "type": "integer"
      },
      "RequestAnnulmentCommand": {
        "required": ["environment", "reason", "lines"],
        "type": "object",
        "properties": {
          "environment": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnnulmentLineInput"
            }
          }
        }
      },
      "SubmitCommercialApprovalBody": {
        "required": ["decision", "rejectionReason"],
        "type": "object",
        "properties": {
          "decision": {
            "type": "string"
          },
          "rejectionReason": {
            "type": ["null", "string"]
          }
        }
      },
      "UpdateEmitterProfileCommand": {
        "required": [
          "address",
          "municipality",
          "province",
          "phones",
          "email",
          "economicActivity"
        ],
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "municipality": {
            "type": ["null", "string"]
          },
          "province": {
            "type": ["null", "string"]
          },
          "phones": {
            "type": ["null", "array"],
            "items": {
              "type": "string"
            }
          },
          "email": {
            "type": ["null", "string"]
          },
          "economicActivity": {
            "type": ["null", "string"]
          }
        },
        "description": "Actualiza el perfil fiscal del emisor del tenant actual — self-service,\n`admin_tenant`. A propósito **no** lleva `DefaultEnvironment`:\npasar de un ambiente a otro exige certificado y rango de secuencia\nautorizados en el ambiente destino, algo que solo el operador puede\nconfirmar. Ese campo sigue siendo del operador\n(`TenantsController.SetEmitterProfile` →\n`SetEmitterProfileCommand`). Tampoco crea el perfil si no existe\n(eso es parte del onboarding, de operador) — solo actualiza uno ya\ncreado."
      },
      "UpdateInboundEcfSettingsCommand": {
        "required": ["requireBearerAuth"],
        "type": "object",
        "properties": {
          "requireBearerAuth": {
            "type": "boolean"
          }
        }
      },
      "UpdateWebhookEndpointRequest": {
        "required": ["url", "events", "enabled", "description"],
        "type": "object",
        "properties": {
          "url": {
            "type": ["null", "string"]
          },
          "events": {
            "type": ["null", "array"],
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": ["null", "boolean"]
          },
          "description": {
            "type": ["null", "string"]
          }
        }
      },
      "ValidateEcfIssueDto": {
        "required": ["field", "code", "message"],
        "type": "object",
        "properties": {
          "field": {
            "type": ["null", "string"],
            "description": "Campo del payload al que se refiere (p. ej. `Lines[0].Quantity`); `null` si es de todo el comprobante."
          },
          "code": {
            "type": "string",
            "description": "Código estable, apto para lógica del cliente."
          },
          "message": {
            "type": "string",
            "description": "Descripción lista para mostrar."
          }
        },
        "description": "Un error o aviso de `POST /api/v1/ecf/validate`."
      },
      "ValidateEcfPreviewDto": {
        "required": [
          "type",
          "typeName",
          "sampleEncf",
          "issueDate",
          "sequenceExpiresOnEstimate",
          "montoGravadoTotal",
          "montoExento",
          "totalItbis",
          "montoImpuestoAdicional",
          "montoTotal",
          "expectConditionalAcceptance"
        ],
        "type": "object",
        "properties": {
          "type": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "typeName": {
            "type": "string"
          },
          "sampleEncf": {
            "type": "string",
            "description": "Placeholder (`E{tipo}0000000000`) — nunca un e-NCF real, no se asignó\nninguna secuencia para construir este documento."
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "sequenceExpiresOnEstimate": {
            "type": ["null", "string"],
            "description": "Estimado (31-dic del año siguiente a DateOnly ValidateEcfPreviewDto.IssueDate) cuando el tipo\nlo lleva; no viene de una secuencia real. `null` en los tipos que no lo\nllevan (32, 34).",
            "format": "date"
          },
          "montoGravadoTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "montoExento": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "totalItbis": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "montoImpuestoAdicional": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "montoTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": ["number", "string"],
            "format": "double"
          },
          "expectConditionalAcceptance": {
            "type": "boolean",
            "description": "Los totales quedarían fuera de la tolerancia de cuadratura (RF-06.6) — la\nDGII probablemente aceptaría el comprobante de forma condicional si se emite así."
          }
        },
        "description": "Vista previa de `POST /api/v1/ecf/validate` para un payload válido: pasó la matriz de\nvalidación por tipo (Módulo 2) y el cálculo de totales (Módulo 6) sin asignar\nuna secuencia real, firmar ni persistir nada."
      },
      "ValidateEcfResultDto": {
        "required": ["valid", "message", "errors", "warnings", "preview"],
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean",
            "description": "`true` si el comprobante se podría emitir tal cual en cuanto a su contenido."
          },
          "message": {
            "type": "string",
            "description": "Resumen en una frase, listo para mostrar."
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidateEcfIssueDto"
            },
            "description": "Todos los problemas encontrados, no solo el primero. Vacío si bool ValidateEcfResultDto.Valid."
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidateEcfIssueDto"
            },
            "description": "Avisos que no impiden emitir (p. ej. aceptación condicional probable)."
          },
          "preview": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "La vista previa de lo que se emitiría; `null` si el comprobante no es válido.",
                "$ref": "#/components/schemas/ValidateEcfPreviewDto"
              }
            ]
          }
        },
        "description": "Resultado de `POST /api/v1/ecf/validate`. Siempre llega con `200` cuando\nel cuerpo se pudo leer y el contribuyente puede validar: bool ValidateEcfResultDto.Valid dice si\nel comprobante pasaría la validación de forma y la matriz estructural y fiscal por\ntipo (Módulo 2 + 6) que corre `POST /ecf`. No asigna una secuencia real, no\nfirma y no persiste nada. Lo que impide validar (sin autenticar, perfil del emisor\nsin configurar) sigue siendo un error HTTP."
      },
      "ValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": ["null", "string"]
          },
          "title": {
            "type": ["null", "string"]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "format": "int32"
          },
          "detail": {
            "type": ["null", "string"]
          },
          "instance": {
            "type": ["null", "string"]
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "WebhookDeliveryDto": {
        "required": [
          "id",
          "eventId",
          "eventType",
          "status",
          "attempts",
          "lastStatusCode",
          "lastError",
          "nextAttemptAt",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "eventId": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "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"]
          },
          "nextAttemptAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Una entrega (o intento) registrada para un endpoint. Log, no el payload completo."
      },
      "WebhookEndpointCreatedDto": {
        "required": ["endpoint", "secret"],
        "type": "object",
        "properties": {
          "endpoint": {
            "$ref": "#/components/schemas/WebhookEndpointDto"
          },
          "secret": {
            "type": "string"
          }
        },
        "description": "Respuesta de la creación de un endpoint: la vista más el <b>secret en claro</b>,\nque solo se devuelve aquí (y en `rotate-secret`) y no se puede recuperar."
      },
      "WebhookEndpointDto": {
        "required": [
          "id",
          "tenantId",
          "url",
          "description",
          "events",
          "enabled",
          "consecutiveFailures",
          "disabledReason",
          "disabledAt",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "description": {
            "type": ["null", "string"]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "consecutiveFailures": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["integer", "string"],
            "format": "int32"
          },
          "disabledReason": {
            "type": ["null", "string"]
          },
          "disabledAt": {
            "type": ["null", "string"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": ["null", "string"],
            "format": "date-time"
          }
        },
        "description": "Vista de un endpoint de webhook. Nunca incluye el `secret`."
      },
      "WebhookPingResultDto": {
        "required": ["delivered", "statusCode", "error"],
        "type": "object",
        "properties": {
          "delivered": {
            "type": "boolean"
          },
          "statusCode": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": ["null", "integer", "string"],
            "format": "int32"
          },
          "error": {
            "type": ["null", "string"]
          }
        },
        "description": "Resultado de un `ping`: si el endpoint respondió `2xx` y con qué código."
      },
      "WebhookSecretDto": {
        "required": ["secret"],
        "type": "object",
        "properties": {
          "secret": {
            "type": "string"
          }
        },
        "description": "Respuesta de `rotate-secret`: el nuevo secret en claro."
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "API key del contribuyente (formato sk_nfe_<ambiente>_...). Ata el ambiente y el rol.",
        "name": "X-API-Key",
        "in": "header"
      }
    }
  },
  "tags": [
    {
      "name": "Certificates"
    },
    {
      "name": "Dgii"
    },
    {
      "name": "Ecf"
    },
    {
      "name": "EmitterProfile"
    },
    {
      "name": "Finance"
    },
    {
      "name": "InboundEcf"
    },
    {
      "name": "InboundEcfSettings"
    },
    {
      "name": "Organizations"
    },
    {
      "name": "Plans"
    },
    {
      "name": "ReceivedEcf"
    },
    {
      "name": "Sequences"
    },
    {
      "name": "Webhooks"
    }
  ]
}
