{
  "openapi": "3.1.0",
  "info": {
    "title": "Emitoo API — API pública",
    "description": "API pública de Emitoo para integraciones (API keys). Autentícate con el header `X-API-Key: fpk_…`. Solo expone comprobantes (facturas, guías de remisión, retenciones, notas de crédito/débito, liquidaciones de compra), compras, cobros, pagos a proveedores, cuentas de dinero, personas/empresas y servicios.",
    "version": "0.1.0"
  },
  "paths": {
    "/api/v1/facturas/": {
      "get": {
        "tags": [
          "Facturas"
        ],
        "summary": "Listar Facturas",
        "description": "Listado para la tabla del dashboard, acotado por el scope del rol.\n\nSin parámetros responde igual que antes (últimas 100). `desde`/`hasta`\nfiltran por `fecha_emision`, `estado` por `EstadoFactura` exacto.\n`?format=csv` devuelve el mismo listado como CSV (ver\n`routes/cobros.py::estado_cuenta`, mismo estilo de `StreamingResponse`).\nEl CSV es un export contable: sin `limit` explícito no se trunca a 100\n(tope de seguridad 50000), para que \"ventas del mes\" salga completo.",
        "operationId": "listar_facturas_api_v1_facturas__get",
        "parameters": [
          {
            "name": "desde",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Desde"
            }
          },
          {
            "name": "hasta",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Hasta"
            }
          },
          {
            "name": "estado",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/EstadoFactura"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Estado"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Format"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FacturaListItem"
                  },
                  "title": "Response Listar Facturas Api V1 Facturas  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Facturas"
        ],
        "summary": "Crear Factura",
        "description": "Crea la factura. El procesamiento ante el SRI lo hace el WORKER (durable).\n\nRetorna de inmediato con estado PENDIENTE (o BORRADOR): el documento queda\nencolado en la BD y el worker lo procesa en segundos. El frontend consulta\n/facturas/{id}/status para ver AUTORIZADO / RECHAZADO.\n\nIdempotencia: reintentar el POST con la misma `Idempotency-Key` (header o\ncampo del body) devuelve la MISMA factura (200), sin duplicar ni gastar otro\nsecuencial.",
        "operationId": "crear_factura_api_v1_facturas__post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FacturaCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacturaRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/facturas/export-xml": {
      "get": {
        "tags": [
          "Facturas"
        ],
        "summary": "Exportar Xml",
        "description": "ZIP en memoria con el `xml_firmado` de las facturas AUTORIZADO del\ntenant emitidas en (anio, mes) — un archivo `{clave_acceso}.xml` por\nfactura.",
        "operationId": "exportar_xml_api_v1_facturas_export_xml_get",
        "parameters": [
          {
            "name": "anio",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Anio"
            }
          },
          {
            "name": "mes",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mes"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/facturas/{factura_id}": {
      "get": {
        "tags": [
          "Facturas"
        ],
        "summary": "Obtener Factura",
        "operationId": "obtener_factura_api_v1_facturas__factura_id__get",
        "parameters": [
          {
            "name": "factura_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Factura Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacturaRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/facturas/{factura_id}/status": {
      "get": {
        "tags": [
          "Facturas"
        ],
        "summary": "Estado Factura",
        "description": "Polling del estado de procesamiento ante el SRI.",
        "operationId": "estado_factura_api_v1_facturas__factura_id__status_get",
        "parameters": [
          {
            "name": "factura_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Factura Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacturaStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/facturas/{factura_id}/reenviar": {
      "post": {
        "tags": [
          "Facturas"
        ],
        "summary": "Reenviar Factura",
        "description": "Re-encola la factura para el worker.\n\n- Si fue DEVUELTA/RECHAZADO (falló de verdad): se re-emite con clave NUEVA.\n- Si está colgada (PENDIENTE/EN_PROCESO/timeout): se CONSERVA la clave y el\n  worker solo re-consulta la autorización (idempotente, sin duplicar).",
        "operationId": "reenviar_factura_api_v1_facturas__factura_id__reenviar_post",
        "parameters": [
          {
            "name": "factura_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Factura Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacturaStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/facturas/{factura_id}/ride": {
      "get": {
        "tags": [
          "Facturas"
        ],
        "summary": "Obtener Ride",
        "description": "Genera y devuelve el RIDE en PDF de la factura.",
        "operationId": "obtener_ride_api_v1_facturas__factura_id__ride_get",
        "parameters": [
          {
            "name": "factura_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Factura Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/facturas/{factura_id}/xml": {
      "get": {
        "tags": [
          "Facturas"
        ],
        "summary": "Obtener Xml",
        "description": "Descarga el XML firmado de la factura.",
        "operationId": "obtener_xml_api_v1_facturas__factura_id__xml_get",
        "parameters": [
          {
            "name": "factura_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Factura Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/facturas/{factura_id}/email": {
      "post": {
        "tags": [
          "Facturas"
        ],
        "summary": "Enviar Email Factura",
        "description": "Envía la factura por email al destinatario del comprobante (o `to`).",
        "operationId": "enviar_email_factura_api_v1_facturas__factura_id__email_post",
        "parameters": [
          {
            "name": "factura_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Factura Id"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/facturas/{factura_id}/anular": {
      "post": {
        "tags": [
          "Facturas"
        ],
        "summary": "Anular Factura",
        "description": "Anula localmente la factura (no se emite al SRI). Solo permitido desde AUTORIZADO.",
        "operationId": "anular_factura_api_v1_facturas__factura_id__anular_post",
        "parameters": [
          {
            "name": "factura_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Factura Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnularComprobanteIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacturaRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/personas-empresas/": {
      "get": {
        "tags": [
          "Personas/Empresas"
        ],
        "summary": "Listar",
        "operationId": "listar_api_v1_personas_empresas__get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PersonaEmpresaRead"
                  },
                  "title": "Response Listar Api V1 Personas Empresas  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Personas/Empresas"
        ],
        "summary": "Crear",
        "operationId": "crear_api_v1_personas_empresas__post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonaEmpresaCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaEmpresaRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/personas-empresas/lookup/{identificacion}": {
      "get": {
        "tags": [
          "Personas/Empresas"
        ],
        "summary": "Lookup",
        "description": "Busca por RUC/cédula: primero local (de SU empresa), luego el catastro SRI.",
        "operationId": "lookup_api_v1_personas_empresas_lookup__identificacion__get",
        "parameters": [
          {
            "name": "identificacion",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Identificacion"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupResult"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/personas-empresas/{pe_id}": {
      "get": {
        "tags": [
          "Personas/Empresas"
        ],
        "summary": "Obtener",
        "operationId": "obtener_api_v1_personas_empresas__pe_id__get",
        "parameters": [
          {
            "name": "pe_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Pe Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaEmpresaRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Personas/Empresas"
        ],
        "summary": "Actualizar",
        "operationId": "actualizar_api_v1_personas_empresas__pe_id__put",
        "parameters": [
          {
            "name": "pe_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Pe Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonaEmpresaUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaEmpresaRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Personas/Empresas"
        ],
        "summary": "Eliminar",
        "operationId": "eliminar_api_v1_personas_empresas__pe_id__delete",
        "parameters": [
          {
            "name": "pe_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Pe Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servicios/": {
      "get": {
        "tags": [
          "Servicios"
        ],
        "summary": "Listar",
        "operationId": "listar_api_v1_servicios__get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ServicioRead"
                  },
                  "title": "Response Listar Api V1 Servicios  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Servicios"
        ],
        "summary": "Crear",
        "operationId": "crear_api_v1_servicios__post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServicioCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServicioRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servicios/{servicio_id}": {
      "get": {
        "tags": [
          "Servicios"
        ],
        "summary": "Obtener",
        "operationId": "obtener_api_v1_servicios__servicio_id__get",
        "parameters": [
          {
            "name": "servicio_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Servicio Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServicioRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Servicios"
        ],
        "summary": "Actualizar",
        "operationId": "actualizar_api_v1_servicios__servicio_id__put",
        "parameters": [
          {
            "name": "servicio_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Servicio Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServicioUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServicioRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Servicios"
        ],
        "summary": "Eliminar",
        "operationId": "eliminar_api_v1_servicios__servicio_id__delete",
        "parameters": [
          {
            "name": "servicio_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Servicio Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/guias-remision/": {
      "get": {
        "tags": [
          "GuiasRemision"
        ],
        "summary": "Listar",
        "operationId": "listar_api_v1_guias_remision__get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GuiaRemisionListItem"
                  },
                  "title": "Response Listar Api V1 Guias Remision  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "GuiasRemision"
        ],
        "summary": "Crear",
        "operationId": "crear_api_v1_guias_remision__post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GuiaRemisionCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuiaRemisionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/guias-remision/{guia_id}": {
      "get": {
        "tags": [
          "GuiasRemision"
        ],
        "summary": "Obtener",
        "operationId": "obtener_api_v1_guias_remision__guia_id__get",
        "parameters": [
          {
            "name": "guia_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Guia Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuiaRemisionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/guias-remision/{guia_id}/status": {
      "get": {
        "tags": [
          "GuiasRemision"
        ],
        "summary": "Estado",
        "operationId": "estado_api_v1_guias_remision__guia_id__status_get",
        "parameters": [
          {
            "name": "guia_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Guia Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/guias-remision/{guia_id}/ride": {
      "get": {
        "tags": [
          "GuiasRemision"
        ],
        "summary": "Obtener Ride",
        "operationId": "obtener_ride_api_v1_guias_remision__guia_id__ride_get",
        "parameters": [
          {
            "name": "guia_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Guia Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/guias-remision/{guia_id}/xml": {
      "get": {
        "tags": [
          "GuiasRemision"
        ],
        "summary": "Obtener Xml",
        "description": "Descarga el XML firmado de la guía de remisión.",
        "operationId": "obtener_xml_api_v1_guias_remision__guia_id__xml_get",
        "parameters": [
          {
            "name": "guia_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Guia Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/guias-remision/{guia_id}/email": {
      "post": {
        "tags": [
          "GuiasRemision"
        ],
        "summary": "Enviar Email Guia",
        "operationId": "enviar_email_guia_api_v1_guias_remision__guia_id__email_post",
        "parameters": [
          {
            "name": "guia_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Guia Id"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/guias-remision/{guia_id}/anular": {
      "post": {
        "tags": [
          "GuiasRemision"
        ],
        "summary": "Anular Guia",
        "operationId": "anular_guia_api_v1_guias_remision__guia_id__anular_post",
        "parameters": [
          {
            "name": "guia_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Guia Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnularComprobanteIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuiaRemisionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/retenciones/": {
      "get": {
        "tags": [
          "Retenciones"
        ],
        "summary": "Listar",
        "description": "Sin parámetros responde igual que antes. `desde`/`hasta` filtran por\n`fecha_emision`, `estado` por `EstadoFactura`, `periodo_fiscal` exacto.\n`?format=csv` devuelve el mismo listado como CSV (export contable: sin\n`limit` explícito no se trunca a 100; tope de seguridad 50000).",
        "operationId": "listar_api_v1_retenciones__get",
        "parameters": [
          {
            "name": "desde",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Desde"
            }
          },
          {
            "name": "hasta",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Hasta"
            }
          },
          {
            "name": "estado",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/EstadoFactura"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Estado"
            }
          },
          {
            "name": "periodo_fiscal",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Periodo Fiscal"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Format"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RetencionListItem"
                  },
                  "title": "Response Listar Api V1 Retenciones  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Retenciones"
        ],
        "summary": "Crear",
        "operationId": "crear_api_v1_retenciones__post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RetencionCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetencionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/retenciones/{ret_id}": {
      "get": {
        "tags": [
          "Retenciones"
        ],
        "summary": "Obtener",
        "operationId": "obtener_api_v1_retenciones__ret_id__get",
        "parameters": [
          {
            "name": "ret_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Ret Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetencionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/retenciones/{ret_id}/status": {
      "get": {
        "tags": [
          "Retenciones"
        ],
        "summary": "Estado",
        "operationId": "estado_api_v1_retenciones__ret_id__status_get",
        "parameters": [
          {
            "name": "ret_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Ret Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/retenciones/{ret_id}/ride": {
      "get": {
        "tags": [
          "Retenciones"
        ],
        "summary": "Obtener Ride",
        "operationId": "obtener_ride_api_v1_retenciones__ret_id__ride_get",
        "parameters": [
          {
            "name": "ret_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Ret Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/retenciones/{ret_id}/xml": {
      "get": {
        "tags": [
          "Retenciones"
        ],
        "summary": "Obtener Xml",
        "description": "Descarga el XML firmado de la retención.",
        "operationId": "obtener_xml_api_v1_retenciones__ret_id__xml_get",
        "parameters": [
          {
            "name": "ret_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Ret Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/retenciones/{ret_id}/email": {
      "post": {
        "tags": [
          "Retenciones"
        ],
        "summary": "Enviar Email Retencion",
        "operationId": "enviar_email_retencion_api_v1_retenciones__ret_id__email_post",
        "parameters": [
          {
            "name": "ret_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Ret Id"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/retenciones/{ret_id}/anular": {
      "post": {
        "tags": [
          "Retenciones"
        ],
        "summary": "Anular Retencion",
        "operationId": "anular_retencion_api_v1_retenciones__ret_id__anular_post",
        "parameters": [
          {
            "name": "ret_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Ret Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnularComprobanteIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetencionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-credito/": {
      "get": {
        "tags": [
          "NotasCredito"
        ],
        "summary": "Listar",
        "operationId": "listar_api_v1_notas_credito__get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NotaCreditoListItem"
                  },
                  "title": "Response Listar Api V1 Notas Credito  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "NotasCredito"
        ],
        "summary": "Crear",
        "description": "Crea una nota de crédito. Procesamiento async ante el SRI (mismo pipeline\ndurable que la factura). Idempotencia: misma key → misma NC.",
        "operationId": "crear_api_v1_notas_credito__post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotaCreditoCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaCreditoRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-credito/{nc_id}": {
      "get": {
        "tags": [
          "NotasCredito"
        ],
        "summary": "Obtener",
        "operationId": "obtener_api_v1_notas_credito__nc_id__get",
        "parameters": [
          {
            "name": "nc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nc Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaCreditoRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-credito/{nc_id}/status": {
      "get": {
        "tags": [
          "NotasCredito"
        ],
        "summary": "Estado",
        "operationId": "estado_api_v1_notas_credito__nc_id__status_get",
        "parameters": [
          {
            "name": "nc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nc Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-credito/{nc_id}/reenviar": {
      "post": {
        "tags": [
          "NotasCredito"
        ],
        "summary": "Reenviar",
        "description": "Re-encola la NC: si fue DEVUELTA/RECHAZADO re-emite con clave nueva.",
        "operationId": "reenviar_api_v1_notas_credito__nc_id__reenviar_post",
        "parameters": [
          {
            "name": "nc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nc Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-credito/{nc_id}/ride": {
      "get": {
        "tags": [
          "NotasCredito"
        ],
        "summary": "Obtener Ride",
        "operationId": "obtener_ride_api_v1_notas_credito__nc_id__ride_get",
        "parameters": [
          {
            "name": "nc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nc Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-credito/{nc_id}/xml": {
      "get": {
        "tags": [
          "NotasCredito"
        ],
        "summary": "Obtener Xml",
        "description": "Descarga el XML firmado de la nota de crédito.",
        "operationId": "obtener_xml_api_v1_notas_credito__nc_id__xml_get",
        "parameters": [
          {
            "name": "nc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nc Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-credito/{nc_id}/email": {
      "post": {
        "tags": [
          "NotasCredito"
        ],
        "summary": "Enviar Email Nc",
        "description": "Envía la NC por email (a `to` o al email del comprador).",
        "operationId": "enviar_email_nc_api_v1_notas_credito__nc_id__email_post",
        "parameters": [
          {
            "name": "nc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nc Id"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-credito/{nc_id}/anular": {
      "post": {
        "tags": [
          "NotasCredito"
        ],
        "summary": "Anular Nc",
        "operationId": "anular_nc_api_v1_notas_credito__nc_id__anular_post",
        "parameters": [
          {
            "name": "nc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nc Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnularComprobanteIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaCreditoRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-debito/": {
      "get": {
        "tags": [
          "NotasDebito"
        ],
        "summary": "Listar",
        "operationId": "listar_api_v1_notas_debito__get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NotaDebitoListItem"
                  },
                  "title": "Response Listar Api V1 Notas Debito  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "NotasDebito"
        ],
        "summary": "Crear",
        "description": "Crea una nota de débito. Procesamiento async ante el SRI.",
        "operationId": "crear_api_v1_notas_debito__post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotaDebitoCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaDebitoRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-debito/{nd_id}": {
      "get": {
        "tags": [
          "NotasDebito"
        ],
        "summary": "Obtener",
        "operationId": "obtener_api_v1_notas_debito__nd_id__get",
        "parameters": [
          {
            "name": "nd_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nd Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaDebitoRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-debito/{nd_id}/status": {
      "get": {
        "tags": [
          "NotasDebito"
        ],
        "summary": "Estado",
        "operationId": "estado_api_v1_notas_debito__nd_id__status_get",
        "parameters": [
          {
            "name": "nd_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nd Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-debito/{nd_id}/reenviar": {
      "post": {
        "tags": [
          "NotasDebito"
        ],
        "summary": "Reenviar",
        "description": "Re-encola la ND: si fue DEVUELTA/RECHAZADO re-emite con clave nueva.",
        "operationId": "reenviar_api_v1_notas_debito__nd_id__reenviar_post",
        "parameters": [
          {
            "name": "nd_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nd Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-debito/{nd_id}/ride": {
      "get": {
        "tags": [
          "NotasDebito"
        ],
        "summary": "Obtener Ride",
        "operationId": "obtener_ride_api_v1_notas_debito__nd_id__ride_get",
        "parameters": [
          {
            "name": "nd_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nd Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-debito/{nd_id}/xml": {
      "get": {
        "tags": [
          "NotasDebito"
        ],
        "summary": "Obtener Xml",
        "description": "Descarga el XML firmado de la nota de débito.",
        "operationId": "obtener_xml_api_v1_notas_debito__nd_id__xml_get",
        "parameters": [
          {
            "name": "nd_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nd Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-debito/{nd_id}/email": {
      "post": {
        "tags": [
          "NotasDebito"
        ],
        "summary": "Enviar Email Nd",
        "operationId": "enviar_email_nd_api_v1_notas_debito__nd_id__email_post",
        "parameters": [
          {
            "name": "nd_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nd Id"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notas-debito/{nd_id}/anular": {
      "post": {
        "tags": [
          "NotasDebito"
        ],
        "summary": "Anular Nd",
        "operationId": "anular_nd_api_v1_notas_debito__nd_id__anular_post",
        "parameters": [
          {
            "name": "nd_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Nd Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnularComprobanteIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaDebitoRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/liquidaciones-compra/": {
      "get": {
        "tags": [
          "Liquidaciones"
        ],
        "summary": "Listar",
        "operationId": "listar_api_v1_liquidaciones_compra__get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LiquidacionListItem"
                  },
                  "title": "Response Listar Api V1 Liquidaciones Compra  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Liquidaciones"
        ],
        "summary": "Crear",
        "description": "Crea una liquidación. Procesamiento async ante el SRI.",
        "operationId": "crear_api_v1_liquidaciones_compra__post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LiquidacionCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiquidacionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/liquidaciones-compra/{lc_id}": {
      "get": {
        "tags": [
          "Liquidaciones"
        ],
        "summary": "Obtener",
        "operationId": "obtener_api_v1_liquidaciones_compra__lc_id__get",
        "parameters": [
          {
            "name": "lc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Lc Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiquidacionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/liquidaciones-compra/{lc_id}/status": {
      "get": {
        "tags": [
          "Liquidaciones"
        ],
        "summary": "Estado",
        "operationId": "estado_api_v1_liquidaciones_compra__lc_id__status_get",
        "parameters": [
          {
            "name": "lc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Lc Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/liquidaciones-compra/{lc_id}/reenviar": {
      "post": {
        "tags": [
          "Liquidaciones"
        ],
        "summary": "Reenviar",
        "description": "Re-encola la liquidación: si fue DEVUELTA/RECHAZADO re-emite con clave nueva.",
        "operationId": "reenviar_api_v1_liquidaciones_compra__lc_id__reenviar_post",
        "parameters": [
          {
            "name": "lc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Lc Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/liquidaciones-compra/{lc_id}/ride": {
      "get": {
        "tags": [
          "Liquidaciones"
        ],
        "summary": "Obtener Ride",
        "operationId": "obtener_ride_api_v1_liquidaciones_compra__lc_id__ride_get",
        "parameters": [
          {
            "name": "lc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Lc Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/liquidaciones-compra/{lc_id}/xml": {
      "get": {
        "tags": [
          "Liquidaciones"
        ],
        "summary": "Obtener Xml",
        "description": "Descarga el XML firmado de la liquidación.",
        "operationId": "obtener_xml_api_v1_liquidaciones_compra__lc_id__xml_get",
        "parameters": [
          {
            "name": "lc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Lc Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/liquidaciones-compra/{lc_id}/email": {
      "post": {
        "tags": [
          "Liquidaciones"
        ],
        "summary": "Enviar Email Lc",
        "operationId": "enviar_email_lc_api_v1_liquidaciones_compra__lc_id__email_post",
        "parameters": [
          {
            "name": "lc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Lc Id"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/liquidaciones-compra/{lc_id}/anular": {
      "post": {
        "tags": [
          "Liquidaciones"
        ],
        "summary": "Anular Lc",
        "operationId": "anular_lc_api_v1_liquidaciones_compra__lc_id__anular_post",
        "parameters": [
          {
            "name": "lc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Lc Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnularComprobanteIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiquidacionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/compras/": {
      "get": {
        "tags": [
          "Compras"
        ],
        "summary": "Listar",
        "description": "Sin parámetros responde igual que antes. `desde`/`hasta` filtran por\n`fecha_emision`. `?format=csv` devuelve el mismo listado como CSV (export\ncontable: sin `limit` explícito no se trunca a 200; tope 50000).",
        "operationId": "listar_api_v1_compras__get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "estado_pago",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Estado Pago"
            }
          },
          {
            "name": "proveedor_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Proveedor Id"
            }
          },
          {
            "name": "include_inactivos",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Include Inactivos"
            }
          },
          {
            "name": "desde",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Desde"
            }
          },
          {
            "name": "hasta",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Hasta"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Format"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CompraListItem"
                  },
                  "title": "Response Listar Api V1 Compras  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/compras": {
      "post": {
        "tags": [
          "Compras"
        ],
        "summary": "Crear",
        "operationId": "crear_api_v1_compras_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompraCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompraRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/compras/{c_id}": {
      "get": {
        "tags": [
          "Compras"
        ],
        "summary": "Obtener",
        "operationId": "obtener_api_v1_compras__c_id__get",
        "parameters": [
          {
            "name": "c_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "C Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompraRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Compras"
        ],
        "summary": "Actualizar",
        "operationId": "actualizar_api_v1_compras__c_id__patch",
        "parameters": [
          {
            "name": "c_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "C Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompraUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompraRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Compras"
        ],
        "summary": "Eliminar",
        "description": "Baja lógica: marca activo=False. NO borra físicamente.",
        "operationId": "eliminar_api_v1_compras__c_id__delete",
        "parameters": [
          {
            "name": "c_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "C Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompraRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/compras/_meta/categorias": {
      "get": {
        "tags": [
          "Compras"
        ],
        "summary": "Listar Categorias",
        "description": "Autocompletar: lista las categorías ya usadas por el tenant.",
        "operationId": "listar_categorias_api_v1_compras__meta_categorias_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/compras/importar-xml": {
      "post": {
        "tags": [
          "Compras"
        ],
        "summary": "Importar Xml",
        "description": "Recibe un XML (multipart) y devuelve un CompraInPreview. NO persiste:\nel cliente revisa y confirma con POST /compras/.\n\nAcepta tanto el envoltorio SRI (`<autorizacion><comprobante>...`) como\nel XML plano (`<factura id=\"comprobante\">...`).",
        "operationId": "importar_xml_api_v1_compras_importar_xml_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_importar_xml_api_v1_compras_importar_xml_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompraInPreview"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cobros/": {
      "get": {
        "tags": [
          "Cobros"
        ],
        "summary": "Listar",
        "operationId": "listar_api_v1_cobros__get",
        "parameters": [
          {
            "name": "cliente_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cliente Id"
            }
          },
          {
            "name": "desde",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Desde"
            }
          },
          {
            "name": "hasta",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Hasta"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CobroListItem"
                  },
                  "title": "Response Listar Api V1 Cobros  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Cobros"
        ],
        "summary": "Crear",
        "operationId": "crear_api_v1_cobros__post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CobroCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CobroRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cobros/cartera": {
      "get": {
        "tags": [
          "Cobros"
        ],
        "summary": "Cartera",
        "operationId": "cartera_api_v1_cobros_cartera_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarteraOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cobros/estado-cuenta/{cliente_id}": {
      "get": {
        "tags": [
          "Cobros"
        ],
        "summary": "Estado Cuenta",
        "operationId": "estado_cuenta_api_v1_cobros_estado_cuenta__cliente_id__get",
        "parameters": [
          {
            "name": "cliente_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Cliente Id"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Format"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstadoCuentaOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cobros/estado-cuenta/{cliente_id}/pdf": {
      "get": {
        "tags": [
          "Cobros"
        ],
        "summary": "Estado Cuenta Pdf",
        "operationId": "estado_cuenta_pdf_api_v1_cobros_estado_cuenta__cliente_id__pdf_get",
        "parameters": [
          {
            "name": "cliente_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Cliente Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cobros/{cobro_id}": {
      "get": {
        "tags": [
          "Cobros"
        ],
        "summary": "Obtener",
        "operationId": "obtener_api_v1_cobros__cobro_id__get",
        "parameters": [
          {
            "name": "cobro_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Cobro Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CobroRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cobros/{cobro_id}/anular": {
      "post": {
        "tags": [
          "Cobros"
        ],
        "summary": "Anular",
        "operationId": "anular_api_v1_cobros__cobro_id__anular_post",
        "parameters": [
          {
            "name": "cobro_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Cobro Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CobroAnularIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CobroRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/pagos-proveedor/": {
      "get": {
        "tags": [
          "PagosProveedor"
        ],
        "summary": "Listar",
        "operationId": "listar_api_v1_pagos_proveedor__get",
        "parameters": [
          {
            "name": "proveedor_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Proveedor Id"
            }
          },
          {
            "name": "desde",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Desde"
            }
          },
          {
            "name": "hasta",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Hasta"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PagoProveedorListItem"
                  },
                  "title": "Response Listar Api V1 Pagos Proveedor  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PagosProveedor"
        ],
        "summary": "Crear",
        "operationId": "crear_api_v1_pagos_proveedor__post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PagoProveedorCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagoProveedorRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/pagos-proveedor/agenda": {
      "get": {
        "tags": [
          "PagosProveedor"
        ],
        "summary": "Agenda",
        "operationId": "agenda_api_v1_pagos_proveedor_agenda_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgendaPagosOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/pagos-proveedor/{pago_id}": {
      "get": {
        "tags": [
          "PagosProveedor"
        ],
        "summary": "Obtener",
        "operationId": "obtener_api_v1_pagos_proveedor__pago_id__get",
        "parameters": [
          {
            "name": "pago_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Pago Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagoProveedorRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/pagos-proveedor/{pago_id}/anular": {
      "post": {
        "tags": [
          "PagosProveedor"
        ],
        "summary": "Anular",
        "operationId": "anular_api_v1_pagos_proveedor__pago_id__anular_post",
        "parameters": [
          {
            "name": "pago_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Pago Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PagoProveedorAnularIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagoProveedorRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cuentas-dinero/": {
      "get": {
        "tags": [
          "CuentasDinero"
        ],
        "summary": "Listar",
        "operationId": "listar_api_v1_cuentas_dinero__get",
        "parameters": [
          {
            "name": "incluir_inactivas",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Incluir Inactivas"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CuentaDineroRead"
                  },
                  "title": "Response Listar Api V1 Cuentas Dinero  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "CuentasDinero"
        ],
        "summary": "Crear",
        "operationId": "crear_api_v1_cuentas_dinero__post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CuentaDineroCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CuentaDineroRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cuentas-dinero/transferencias": {
      "post": {
        "tags": [
          "CuentasDinero"
        ],
        "summary": "Transferir",
        "operationId": "transferir_api_v1_cuentas_dinero_transferencias_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferenciaCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MovimientoDineroRead"
                  },
                  "title": "Response Transferir Api V1 Cuentas Dinero Transferencias Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cuentas-dinero/{cuenta_id}": {
      "get": {
        "tags": [
          "CuentasDinero"
        ],
        "summary": "Obtener",
        "operationId": "obtener_api_v1_cuentas_dinero__cuenta_id__get",
        "parameters": [
          {
            "name": "cuenta_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Cuenta Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CuentaDineroRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "CuentasDinero"
        ],
        "summary": "Actualizar",
        "operationId": "actualizar_api_v1_cuentas_dinero__cuenta_id__patch",
        "parameters": [
          {
            "name": "cuenta_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Cuenta Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CuentaDineroUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CuentaDineroRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "CuentasDinero"
        ],
        "summary": "Eliminar",
        "operationId": "eliminar_api_v1_cuentas_dinero__cuenta_id__delete",
        "parameters": [
          {
            "name": "cuenta_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Cuenta Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cuentas-dinero/{cuenta_id}/movimientos": {
      "get": {
        "tags": [
          "CuentasDinero"
        ],
        "summary": "Listar Movimientos",
        "operationId": "listar_movimientos_api_v1_cuentas_dinero__cuenta_id__movimientos_get",
        "parameters": [
          {
            "name": "cuenta_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Cuenta Id"
            }
          },
          {
            "name": "desde",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Desde"
            }
          },
          {
            "name": "hasta",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Hasta"
            }
          },
          {
            "name": "tipo",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tipo"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MovimientoDineroRead"
                  },
                  "title": "Response Listar Movimientos Api V1 Cuentas Dinero  Cuenta Id  Movimientos Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "CuentasDinero"
        ],
        "summary": "Crear Movimiento",
        "operationId": "crear_movimiento_api_v1_cuentas_dinero__cuenta_id__movimientos_post",
        "parameters": [
          {
            "name": "cuenta_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Cuenta Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MovimientoDineroCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MovimientoDineroRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sucursales/": {
      "get": {
        "tags": [
          "Sucursales"
        ],
        "summary": "Listar",
        "operationId": "listar_api_v1_sucursales__get",
        "parameters": [
          {
            "name": "tenant_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tenant Id"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SucursalRead"
                  },
                  "title": "Response Listar Api V1 Sucursales  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Sucursales"
        ],
        "summary": "Crear",
        "operationId": "crear_api_v1_sucursales__post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SucursalCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SucursalRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sucursales/{sucursal_id}": {
      "put": {
        "tags": [
          "Sucursales"
        ],
        "summary": "Actualizar",
        "operationId": "actualizar_api_v1_sucursales__sucursal_id__put",
        "parameters": [
          {
            "name": "sucursal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Sucursal Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SucursalCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SucursalRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Sucursales"
        ],
        "summary": "Eliminar",
        "operationId": "eliminar_api_v1_sucursales__sucursal_id__delete",
        "parameters": [
          {
            "name": "sucursal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Sucursal Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/eventos/": {
      "get": {
        "tags": [
          "Eventos"
        ],
        "summary": "Listar",
        "description": "Lista eventos de TU empresa. Con `desde_id` pagina hacia adelante (para\nreconciliar); sin él, devuelve los últimos (diagnóstico).",
        "operationId": "listar_api_v1_eventos__get",
        "parameters": [
          {
            "name": "desde_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor: devuelve eventos con id MAYOR a este, en orden ascendente. Guarda el último id procesado para reconciliar.",
              "title": "Desde Id"
            },
            "description": "Cursor: devuelve eventos con id MAYOR a este, en orden ascendente. Guarda el último id procesado para reconciliar."
          },
          {
            "name": "evento",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Evento"
            }
          },
          {
            "name": "documento_tipo",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Documento Tipo"
            }
          },
          {
            "name": "documento_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Documento Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EventoRead"
                  },
                  "title": "Response Listar Api V1 Eventos  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/eventos/{evento_id}": {
      "get": {
        "tags": [
          "Eventos"
        ],
        "summary": "Obtener",
        "operationId": "obtener_api_v1_eventos__evento_id__get",
        "parameters": [
          {
            "name": "evento_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Evento Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventoRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AgendaPagosCompraItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_doc": {
            "type": "string",
            "title": "Numero Doc"
          },
          "proveedor_razon_social": {
            "type": "string",
            "title": "Proveedor Razon Social"
          },
          "fecha_vencimiento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Vencimiento"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "total_pagado": {
            "type": "number",
            "title": "Total Pagado"
          },
          "saldo": {
            "type": "number",
            "title": "Saldo"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_doc",
          "proveedor_razon_social",
          "fecha_vencimiento",
          "total",
          "total_pagado",
          "saldo"
        ],
        "title": "AgendaPagosCompraItem"
      },
      "AgendaPagosOut": {
        "properties": {
          "semanas": {
            "items": {
              "$ref": "#/components/schemas/AgendaPagosSemana"
            },
            "type": "array",
            "title": "Semanas"
          },
          "total_general": {
            "type": "number",
            "title": "Total General"
          }
        },
        "type": "object",
        "required": [
          "semanas",
          "total_general"
        ],
        "title": "AgendaPagosOut"
      },
      "AgendaPagosSemana": {
        "properties": {
          "semana": {
            "type": "string",
            "title": "Semana"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "cantidad": {
            "type": "integer",
            "title": "Cantidad"
          },
          "compras": {
            "items": {
              "$ref": "#/components/schemas/AgendaPagosCompraItem"
            },
            "type": "array",
            "title": "Compras"
          }
        },
        "type": "object",
        "required": [
          "semana",
          "total",
          "cantidad",
          "compras"
        ],
        "title": "AgendaPagosSemana"
      },
      "AnularComprobanteIn": {
        "properties": {
          "motivo": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "title": "Motivo"
          },
          "fecha": {
            "type": "string",
            "format": "date",
            "title": "Fecha"
          }
        },
        "type": "object",
        "required": [
          "motivo",
          "fecha"
        ],
        "title": "AnularComprobanteIn"
      },
      "ApiKeyCreate": {
        "properties": {
          "nombre": {
            "type": "string",
            "maxLength": 120,
            "title": "Nombre"
          },
          "permisos": {
            "items": {
              "$ref": "#/components/schemas/ApiKeyPermiso"
            },
            "type": "array",
            "title": "Permisos"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "nombre"
        ],
        "title": "ApiKeyCreate"
      },
      "ApiKeyPermiso": {
        "properties": {
          "recurso": {
            "type": "string",
            "title": "Recurso"
          },
          "can_get": {
            "type": "boolean",
            "title": "Can Get",
            "default": false
          },
          "can_post": {
            "type": "boolean",
            "title": "Can Post",
            "default": false
          },
          "can_put": {
            "type": "boolean",
            "title": "Can Put",
            "default": false
          },
          "can_delete": {
            "type": "boolean",
            "title": "Can Delete",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "recurso"
        ],
        "title": "ApiKeyPermiso"
      },
      "ApiKeyRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "nombre": {
            "type": "string",
            "title": "Nombre"
          },
          "prefijo": {
            "type": "string",
            "title": "Prefijo"
          },
          "permisos": {
            "items": {
              "$ref": "#/components/schemas/ApiKeyPermiso"
            },
            "type": "array",
            "title": "Permisos"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "nombre",
          "prefijo",
          "tenant_id",
          "activo",
          "last_used_at",
          "expires_at",
          "created_at"
        ],
        "title": "ApiKeyRead"
      },
      "ApiKeyUpdate": {
        "properties": {
          "nombre": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre"
          },
          "permisos": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ApiKeyPermiso"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Permisos"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          }
        },
        "type": "object",
        "title": "ApiKeyUpdate",
        "description": "Editar una key existente. Solo se actualizan los campos provistos\n(el handler usa model_dump(exclude_unset=True))."
      },
      "AuditLogRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          },
          "actor": {
            "type": "string",
            "title": "Actor"
          },
          "actor_tipo": {
            "type": "string",
            "title": "Actor Tipo"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "method": {
            "type": "string",
            "title": "Method"
          },
          "path": {
            "type": "string",
            "title": "Path"
          },
          "recurso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recurso"
          },
          "status_code": {
            "type": "integer",
            "title": "Status Code"
          },
          "ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip"
          },
          "user_agent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Agent"
          },
          "duration_ms": {
            "type": "integer",
            "title": "Duration Ms"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "tenant_id",
          "actor",
          "actor_tipo",
          "user_id",
          "method",
          "path",
          "recurso",
          "status_code",
          "ip",
          "user_agent",
          "duration_ms",
          "created_at"
        ],
        "title": "AuditLogRead"
      },
      "Body_importar_xml_api_v1_compras_importar_xml_post": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_importar_xml_api_v1_compras_importar_xml_post"
      },
      "Body_subir_certificado_api_v1_configuracion_certificado_post": {
        "properties": {
          "archivo": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "Archivo"
          },
          "password": {
            "type": "string",
            "title": "Password"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          }
        },
        "type": "object",
        "required": [
          "archivo",
          "password"
        ],
        "title": "Body_subir_certificado_api_v1_configuracion_certificado_post"
      },
      "Body_subir_logo_api_v1_configuracion_logo_post": {
        "properties": {
          "archivo": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "Archivo"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          }
        },
        "type": "object",
        "required": [
          "archivo"
        ],
        "title": "Body_subir_logo_api_v1_configuracion_logo_post"
      },
      "CarteraBucket": {
        "properties": {
          "dias": {
            "type": "string",
            "title": "Dias"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "cantidad": {
            "type": "integer",
            "title": "Cantidad"
          }
        },
        "type": "object",
        "required": [
          "dias",
          "total",
          "cantidad"
        ],
        "title": "CarteraBucket"
      },
      "CarteraOut": {
        "properties": {
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/CarteraBucket"
            },
            "type": "array",
            "title": "Buckets"
          },
          "total_general": {
            "type": "number",
            "title": "Total General"
          }
        },
        "type": "object",
        "required": [
          "buckets",
          "total_general"
        ],
        "title": "CarteraOut"
      },
      "CobroAnularIn": {
        "properties": {
          "motivo": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "Motivo"
          }
        },
        "type": "object",
        "required": [
          "motivo"
        ],
        "title": "CobroAnularIn"
      },
      "CobroAplicacionIn": {
        "properties": {
          "factura_id": {
            "type": "integer",
            "title": "Factura Id"
          },
          "monto_aplicado": {
            "type": "number",
            "minimum": 0.0,
            "title": "Monto Aplicado"
          }
        },
        "type": "object",
        "required": [
          "factura_id",
          "monto_aplicado"
        ],
        "title": "CobroAplicacionIn"
      },
      "CobroAplicacionRead": {
        "properties": {
          "factura_id": {
            "type": "integer",
            "title": "Factura Id"
          },
          "monto_aplicado": {
            "type": "number",
            "minimum": 0.0,
            "title": "Monto Aplicado"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          }
        },
        "type": "object",
        "required": [
          "factura_id",
          "monto_aplicado",
          "id"
        ],
        "title": "CobroAplicacionRead"
      },
      "CobroCreate": {
        "properties": {
          "cliente_id": {
            "type": "integer",
            "title": "Cliente Id"
          },
          "fecha": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha"
          },
          "medio": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "title": "Medio"
          },
          "monto": {
            "type": "number",
            "minimum": 0.0,
            "title": "Monto"
          },
          "referencia": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Referencia"
          },
          "notas": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notas"
          },
          "cuenta_dinero_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cuenta Dinero Id"
          },
          "aplicaciones": {
            "items": {
              "$ref": "#/components/schemas/CobroAplicacionIn"
            },
            "type": "array",
            "minItems": 1,
            "title": "Aplicaciones"
          },
          "sucursal_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sucursal Id"
          }
        },
        "type": "object",
        "required": [
          "cliente_id",
          "fecha",
          "medio",
          "monto",
          "aplicaciones"
        ],
        "title": "CobroCreate"
      },
      "CobroListItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "fecha": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha"
          },
          "cliente_id": {
            "type": "integer",
            "title": "Cliente Id"
          },
          "medio": {
            "type": "string",
            "title": "Medio"
          },
          "monto": {
            "type": "number",
            "title": "Monto"
          },
          "referencia": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Referencia"
          },
          "notas": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notas"
          },
          "cuenta_dinero_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cuenta Dinero Id"
          },
          "anulado": {
            "type": "boolean",
            "title": "Anulado",
            "default": false
          },
          "anulado_motivo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Motivo"
          },
          "anulado_en": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado En"
          }
        },
        "type": "object",
        "required": [
          "id",
          "fecha",
          "cliente_id",
          "medio",
          "monto",
          "referencia",
          "notas",
          "cuenta_dinero_id"
        ],
        "title": "CobroListItem"
      },
      "CobroRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "fecha": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha"
          },
          "cliente_id": {
            "type": "integer",
            "title": "Cliente Id"
          },
          "medio": {
            "type": "string",
            "title": "Medio"
          },
          "monto": {
            "type": "number",
            "title": "Monto"
          },
          "referencia": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Referencia"
          },
          "notas": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notas"
          },
          "cuenta_dinero_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cuenta Dinero Id"
          },
          "anulado": {
            "type": "boolean",
            "title": "Anulado",
            "default": false
          },
          "anulado_motivo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Motivo"
          },
          "anulado_en": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado En"
          },
          "creado_en": {
            "type": "string",
            "format": "date-time",
            "title": "Creado En"
          },
          "aplicaciones": {
            "items": {
              "$ref": "#/components/schemas/CobroAplicacionRead"
            },
            "type": "array",
            "title": "Aplicaciones"
          }
        },
        "type": "object",
        "required": [
          "id",
          "fecha",
          "cliente_id",
          "medio",
          "monto",
          "referencia",
          "notas",
          "cuenta_dinero_id",
          "creado_en"
        ],
        "title": "CobroRead"
      },
      "CompraCreate": {
        "properties": {
          "total": {
            "type": "number",
            "minimum": 0.0,
            "title": "Total"
          },
          "proveedor_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proveedor Id"
          },
          "proveedor_tipo_id": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "proveedor_identificacion": {
            "type": "string",
            "maxLength": 20,
            "title": "Proveedor Identificacion"
          },
          "proveedor_razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Proveedor Razon Social"
          },
          "proveedor_direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Proveedor Direccion"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "tipo_doc": {
            "type": "string",
            "maxLength": 2,
            "title": "Tipo Doc",
            "default": "01"
          },
          "numero_doc": {
            "type": "string",
            "maxLength": 17,
            "title": "Numero Doc"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "clave_acceso": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 49
              },
              {
                "type": "null"
              }
            ],
            "title": "Clave Acceso"
          },
          "fecha_vencimiento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Vencimiento"
          },
          "categoria": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Categoria"
          },
          "notas": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notas"
          },
          "detalles": {
            "items": {
              "$ref": "#/components/schemas/DetalleCompraCreate"
            },
            "type": "array",
            "title": "Detalles"
          },
          "sucursal_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sucursal Id"
          },
          "xml_original": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xml Original"
          },
          "subtotal_0": {
            "type": "number",
            "title": "Subtotal 0",
            "default": 0
          },
          "subtotal_5": {
            "type": "number",
            "title": "Subtotal 5",
            "default": 0
          },
          "subtotal_15": {
            "type": "number",
            "title": "Subtotal 15",
            "default": 0
          },
          "subtotal_no_objeto": {
            "type": "number",
            "title": "Subtotal No Objeto",
            "default": 0
          },
          "subtotal_exento": {
            "type": "number",
            "title": "Subtotal Exento",
            "default": 0
          },
          "iva": {
            "type": "number",
            "title": "Iva",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "total",
          "proveedor_tipo_id",
          "proveedor_identificacion",
          "proveedor_razon_social",
          "numero_doc",
          "fecha_emision"
        ],
        "title": "CompraCreate",
        "description": "Payload de creación manual de una compra (Fase 2.1)."
      },
      "CompraInPreview": {
        "properties": {
          "tipo_doc": {
            "type": "string",
            "title": "Tipo Doc"
          },
          "numero_doc": {
            "type": "string",
            "title": "Numero Doc"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "clave_acceso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clave Acceso"
          },
          "proveedor_tipo_id": {
            "type": "string",
            "title": "Proveedor Tipo Id"
          },
          "proveedor_identificacion": {
            "type": "string",
            "title": "Proveedor Identificacion"
          },
          "proveedor_razon_social": {
            "type": "string",
            "title": "Proveedor Razon Social"
          },
          "proveedor_direccion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proveedor Direccion"
          },
          "subtotal_0": {
            "type": "number",
            "title": "Subtotal 0",
            "default": 0
          },
          "subtotal_5": {
            "type": "number",
            "title": "Subtotal 5",
            "default": 0
          },
          "subtotal_15": {
            "type": "number",
            "title": "Subtotal 15",
            "default": 0
          },
          "subtotal_no_objeto": {
            "type": "number",
            "title": "Subtotal No Objeto",
            "default": 0
          },
          "subtotal_exento": {
            "type": "number",
            "title": "Subtotal Exento",
            "default": 0
          },
          "iva": {
            "type": "number",
            "title": "Iva",
            "default": 0
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "detalles": {
            "items": {
              "$ref": "#/components/schemas/DetalleCompraCreate"
            },
            "type": "array",
            "title": "Detalles"
          }
        },
        "type": "object",
        "required": [
          "tipo_doc",
          "numero_doc",
          "fecha_emision",
          "proveedor_tipo_id",
          "proveedor_identificacion",
          "proveedor_razon_social",
          "total"
        ],
        "title": "CompraInPreview",
        "description": "Vista previa de un XML de proveedor parseado. NO se persiste; el\ncliente confirma y hace un POST /compras/ con los campos."
      },
      "CompraListItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "tipo_doc": {
            "type": "string",
            "title": "Tipo Doc"
          },
          "numero_doc": {
            "type": "string",
            "title": "Numero Doc"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "proveedor_razon_social": {
            "type": "string",
            "title": "Proveedor Razon Social"
          },
          "proveedor_identificacion": {
            "type": "string",
            "title": "Proveedor Identificacion"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "total_pagado": {
            "type": "number",
            "title": "Total Pagado",
            "default": 0
          },
          "estado_pago": {
            "type": "string",
            "title": "Estado Pago"
          },
          "fecha_vencimiento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Vencimiento"
          },
          "categoria": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Categoria"
          },
          "proveedor_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proveedor Id"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "id",
          "tipo_doc",
          "numero_doc",
          "fecha_emision",
          "proveedor_razon_social",
          "proveedor_identificacion",
          "total",
          "estado_pago",
          "fecha_vencimiento",
          "categoria"
        ],
        "title": "CompraListItem"
      },
      "CompraRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "tipo_doc": {
            "type": "string",
            "title": "Tipo Doc"
          },
          "numero_doc": {
            "type": "string",
            "title": "Numero Doc"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "proveedor_razon_social": {
            "type": "string",
            "title": "Proveedor Razon Social"
          },
          "proveedor_identificacion": {
            "type": "string",
            "title": "Proveedor Identificacion"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "total_pagado": {
            "type": "number",
            "title": "Total Pagado",
            "default": 0
          },
          "estado_pago": {
            "type": "string",
            "title": "Estado Pago"
          },
          "fecha_vencimiento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Vencimiento"
          },
          "categoria": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Categoria"
          },
          "proveedor_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proveedor Id"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo",
            "default": true
          },
          "proveedor_tipo_id": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "proveedor_direccion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proveedor Direccion"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "clave_acceso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clave Acceso"
          },
          "notas": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notas"
          },
          "subtotal_0": {
            "type": "number",
            "title": "Subtotal 0"
          },
          "subtotal_5": {
            "type": "number",
            "title": "Subtotal 5"
          },
          "subtotal_15": {
            "type": "number",
            "title": "Subtotal 15"
          },
          "subtotal_no_objeto": {
            "type": "number",
            "title": "Subtotal No Objeto"
          },
          "subtotal_exento": {
            "type": "number",
            "title": "Subtotal Exento"
          },
          "iva": {
            "type": "number",
            "title": "Iva"
          },
          "retencion_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retencion Id"
          },
          "detalles": {
            "items": {
              "$ref": "#/components/schemas/DetalleCompraRead"
            },
            "type": "array",
            "title": "Detalles"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "tipo_doc",
          "numero_doc",
          "fecha_emision",
          "proveedor_razon_social",
          "proveedor_identificacion",
          "total",
          "estado_pago",
          "fecha_vencimiento",
          "categoria",
          "proveedor_id",
          "proveedor_tipo_id",
          "proveedor_direccion",
          "email",
          "clave_acceso",
          "notas",
          "subtotal_0",
          "subtotal_5",
          "subtotal_15",
          "subtotal_no_objeto",
          "subtotal_exento",
          "iva",
          "retencion_id",
          "created_at",
          "updated_at"
        ],
        "title": "CompraRead"
      },
      "CompraUpdate": {
        "properties": {
          "categoria": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Categoria"
          },
          "notas": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notas"
          },
          "fecha_vencimiento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Vencimiento"
          },
          "sucursal_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sucursal Id"
          },
          "detalles": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DetalleCompraCreate"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detalles"
          },
          "proveedor_direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Proveedor Direccion"
          }
        },
        "type": "object",
        "title": "CompraUpdate",
        "description": "PATCH: campos editables de una compra ya persistida."
      },
      "ConfiguracionRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "ruc": {
            "type": "string",
            "title": "Ruc"
          },
          "razon_social": {
            "type": "string",
            "title": "Razon Social"
          },
          "nombre_comercial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre Comercial"
          },
          "dir_matriz": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dir Matriz"
          },
          "dir_establecimiento": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dir Establecimiento"
          },
          "obligado_contabilidad": {
            "type": "string",
            "title": "Obligado Contabilidad"
          },
          "regimen_rimpe": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Regimen Rimpe"
          },
          "ambiente_sri": {
            "type": "string",
            "title": "Ambiente Sri"
          },
          "cert_subject": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cert Subject"
          },
          "cert_expira": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cert Expira"
          },
          "cert_filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cert Filename"
          },
          "tiene_certificado": {
            "type": "boolean",
            "title": "Tiene Certificado",
            "default": false
          },
          "tiene_logo": {
            "type": "boolean",
            "title": "Tiene Logo",
            "default": false
          },
          "logo_filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Filename"
          },
          "ride_pie_pagina": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ride Pie Pagina"
          },
          "ride_info_adicional": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ride Info Adicional"
          },
          "ride_color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ride Color"
          },
          "smtp_configurado": {
            "type": "boolean",
            "title": "Smtp Configurado",
            "default": false
          },
          "smtp_host": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Smtp Host"
          },
          "smtp_port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Smtp Port"
          },
          "smtp_user": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Smtp User"
          },
          "smtp_from_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Smtp From Email"
          },
          "smtp_from_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Smtp From Name"
          },
          "smtp_tls": {
            "type": "boolean",
            "title": "Smtp Tls",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "id",
          "ruc",
          "razon_social",
          "nombre_comercial",
          "dir_matriz",
          "dir_establecimiento",
          "obligado_contabilidad",
          "ambiente_sri",
          "cert_subject",
          "cert_expira",
          "cert_filename"
        ],
        "title": "ConfiguracionRead"
      },
      "ConfiguracionUpdate": {
        "properties": {
          "razon_social": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Razon Social"
          },
          "nombre_comercial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre Comercial"
          },
          "dir_matriz": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dir Matriz"
          },
          "dir_establecimiento": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dir Establecimiento"
          },
          "obligado_contabilidad": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Obligado Contabilidad"
          },
          "regimen_rimpe": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "",
                  "emprendedor",
                  "negocio_popular"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Regimen Rimpe"
          },
          "ambiente_sri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ambiente Sri"
          },
          "ride_pie_pagina": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ride Pie Pagina"
          },
          "ride_info_adicional": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ride Info Adicional"
          },
          "ride_color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ride Color"
          },
          "smtp_host": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Smtp Host"
          },
          "smtp_port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Smtp Port"
          },
          "smtp_user": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Smtp User"
          },
          "smtp_password": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Smtp Password"
          },
          "smtp_from_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Smtp From Email"
          },
          "smtp_from_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Smtp From Name"
          },
          "smtp_tls": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Smtp Tls"
          }
        },
        "type": "object",
        "title": "ConfiguracionUpdate"
      },
      "ContactRequest": {
        "properties": {
          "nombre": {
            "type": "string",
            "maxLength": 120,
            "minLength": 2,
            "title": "Nombre"
          },
          "email": {
            "type": "string",
            "maxLength": 300,
            "minLength": 3,
            "title": "Email"
          },
          "mensaje": {
            "type": "string",
            "maxLength": 5000,
            "minLength": 5,
            "title": "Mensaje"
          },
          "website": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Website"
          },
          "recaptcha_token": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "title": "Recaptcha Token"
          },
          "origen": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ],
            "title": "Origen",
            "default": "landing"
          }
        },
        "type": "object",
        "required": [
          "nombre",
          "email",
          "mensaje"
        ],
        "title": "ContactRequest",
        "description": "Body del formulario de la landing. Honeypot + token reCAPTCHA opcionales."
      },
      "ContactResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "ok",
          "message"
        ],
        "title": "ContactResponse"
      },
      "CuentaDineroCreate": {
        "properties": {
          "nombre": {
            "type": "string",
            "maxLength": 120,
            "title": "Nombre"
          },
          "tipo": {
            "type": "string",
            "title": "Tipo"
          },
          "banco": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Banco"
          },
          "numero_mascarado": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 30
              },
              {
                "type": "null"
              }
            ],
            "title": "Numero Mascarado"
          },
          "saldo_inicial": {
            "type": "number",
            "title": "Saldo Inicial",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "nombre",
          "tipo"
        ],
        "title": "CuentaDineroCreate"
      },
      "CuentaDineroRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "nombre": {
            "type": "string",
            "title": "Nombre"
          },
          "tipo": {
            "type": "string",
            "title": "Tipo"
          },
          "banco": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Banco"
          },
          "numero_mascarado": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Numero Mascarado"
          },
          "saldo_inicial": {
            "type": "number",
            "title": "Saldo Inicial"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo"
          },
          "creado_en": {
            "type": "string",
            "format": "date-time",
            "title": "Creado En"
          },
          "saldo_actual": {
            "type": "number",
            "title": "Saldo Actual",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "id",
          "nombre",
          "tipo",
          "banco",
          "numero_mascarado",
          "saldo_inicial",
          "activo",
          "creado_en"
        ],
        "title": "CuentaDineroRead"
      },
      "CuentaDineroUpdate": {
        "properties": {
          "nombre": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre"
          },
          "tipo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tipo"
          },
          "banco": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Banco"
          },
          "numero_mascarado": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 30
              },
              {
                "type": "null"
              }
            ],
            "title": "Numero Mascarado"
          },
          "saldo_inicial": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Saldo Inicial"
          },
          "activo": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Activo"
          }
        },
        "type": "object",
        "title": "CuentaDineroUpdate"
      },
      "DestinatarioGuiaCreate": {
        "properties": {
          "identificacion": {
            "type": "string",
            "maxLength": 20,
            "title": "Identificacion"
          },
          "razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Razon Social"
          },
          "direccion": {
            "type": "string",
            "maxLength": 300,
            "title": "Direccion"
          },
          "motivo_traslado": {
            "type": "string",
            "maxLength": 300,
            "title": "Motivo Traslado"
          },
          "cod_doc_sustento": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cod Doc Sustento"
          },
          "num_doc_sustento": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Num Doc Sustento"
          },
          "num_aut_doc_sustento": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 49
              },
              {
                "type": "null"
              }
            ],
            "title": "Num Aut Doc Sustento"
          },
          "fecha_emision_doc_sustento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Emision Doc Sustento"
          },
          "detalles": {
            "items": {
              "$ref": "#/components/schemas/DetalleGuiaCreate"
            },
            "type": "array",
            "minItems": 1,
            "title": "Detalles"
          }
        },
        "type": "object",
        "required": [
          "identificacion",
          "razon_social",
          "direccion",
          "motivo_traslado",
          "detalles"
        ],
        "title": "DestinatarioGuiaCreate"
      },
      "DetalleCompraCreate": {
        "properties": {
          "codigo_principal": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo Principal"
          },
          "descripcion": {
            "type": "string",
            "maxLength": 300,
            "title": "Descripcion"
          },
          "cantidad": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Cantidad"
          },
          "precio_unitario": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio Unitario"
          },
          "descuento": {
            "type": "number",
            "minimum": 0.0,
            "title": "Descuento",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          }
        },
        "type": "object",
        "required": [
          "codigo_principal",
          "descripcion",
          "cantidad",
          "precio_unitario"
        ],
        "title": "DetalleCompraCreate"
      },
      "DetalleCompraRead": {
        "properties": {
          "codigo_principal": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo Principal"
          },
          "descripcion": {
            "type": "string",
            "maxLength": 300,
            "title": "Descripcion"
          },
          "cantidad": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Cantidad"
          },
          "precio_unitario": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio Unitario"
          },
          "descuento": {
            "type": "number",
            "minimum": 0.0,
            "title": "Descuento",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "subtotal": {
            "type": "number",
            "title": "Subtotal"
          }
        },
        "type": "object",
        "required": [
          "codigo_principal",
          "descripcion",
          "cantidad",
          "precio_unitario",
          "id",
          "subtotal"
        ],
        "title": "DetalleCompraRead"
      },
      "DetalleFacturaCreate": {
        "properties": {
          "codigo_principal": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo Principal"
          },
          "descripcion": {
            "type": "string",
            "maxLength": 300,
            "title": "Descripcion"
          },
          "cantidad": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Cantidad"
          },
          "precio_unitario": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio Unitario"
          },
          "descuento": {
            "type": "number",
            "minimum": 0.0,
            "title": "Descuento",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          }
        },
        "type": "object",
        "required": [
          "codigo_principal",
          "descripcion",
          "cantidad",
          "precio_unitario"
        ],
        "title": "DetalleFacturaCreate"
      },
      "DetalleFacturaRead": {
        "properties": {
          "codigo_principal": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo Principal"
          },
          "descripcion": {
            "type": "string",
            "maxLength": 300,
            "title": "Descripcion"
          },
          "cantidad": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Cantidad"
          },
          "precio_unitario": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio Unitario"
          },
          "descuento": {
            "type": "number",
            "minimum": 0.0,
            "title": "Descuento",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "subtotal": {
            "type": "number",
            "title": "Subtotal"
          }
        },
        "type": "object",
        "required": [
          "codigo_principal",
          "descripcion",
          "cantidad",
          "precio_unitario",
          "id",
          "subtotal"
        ],
        "title": "DetalleFacturaRead"
      },
      "DetalleGuiaCreate": {
        "properties": {
          "codigo_interno": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo Interno"
          },
          "descripcion": {
            "type": "string",
            "maxLength": 300,
            "title": "Descripcion"
          },
          "cantidad": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Cantidad"
          }
        },
        "type": "object",
        "required": [
          "codigo_interno",
          "descripcion",
          "cantidad"
        ],
        "title": "DetalleGuiaCreate"
      },
      "DetalleLiquidacionCreate": {
        "properties": {
          "codigo_principal": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo Principal"
          },
          "descripcion": {
            "type": "string",
            "maxLength": 300,
            "title": "Descripcion"
          },
          "cantidad": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Cantidad"
          },
          "precio_unitario": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio Unitario"
          },
          "descuento": {
            "type": "number",
            "minimum": 0.0,
            "title": "Descuento",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          }
        },
        "type": "object",
        "required": [
          "codigo_principal",
          "descripcion",
          "cantidad",
          "precio_unitario"
        ],
        "title": "DetalleLiquidacionCreate",
        "description": "Línea de producto/servicio de la liquidación (mismo shape que factura)."
      },
      "DetalleLiquidacionRead": {
        "properties": {
          "codigo_principal": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo Principal"
          },
          "descripcion": {
            "type": "string",
            "maxLength": 300,
            "title": "Descripcion"
          },
          "cantidad": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Cantidad"
          },
          "precio_unitario": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio Unitario"
          },
          "descuento": {
            "type": "number",
            "minimum": 0.0,
            "title": "Descuento",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "subtotal": {
            "type": "number",
            "title": "Subtotal"
          }
        },
        "type": "object",
        "required": [
          "codigo_principal",
          "descripcion",
          "cantidad",
          "precio_unitario",
          "id",
          "subtotal"
        ],
        "title": "DetalleLiquidacionRead"
      },
      "DetalleNotaCreditoCreate": {
        "properties": {
          "codigo_principal": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo Principal"
          },
          "descripcion": {
            "type": "string",
            "maxLength": 300,
            "title": "Descripcion"
          },
          "cantidad": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Cantidad"
          },
          "precio_unitario": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio Unitario"
          },
          "descuento": {
            "type": "number",
            "minimum": 0.0,
            "title": "Descuento",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          }
        },
        "type": "object",
        "required": [
          "codigo_principal",
          "descripcion",
          "cantidad",
          "precio_unitario"
        ],
        "title": "DetalleNotaCreditoCreate"
      },
      "DetalleNotaCreditoRead": {
        "properties": {
          "codigo_principal": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo Principal"
          },
          "descripcion": {
            "type": "string",
            "maxLength": 300,
            "title": "Descripcion"
          },
          "cantidad": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Cantidad"
          },
          "precio_unitario": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio Unitario"
          },
          "descuento": {
            "type": "number",
            "minimum": 0.0,
            "title": "Descuento",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "subtotal": {
            "type": "number",
            "title": "Subtotal"
          }
        },
        "type": "object",
        "required": [
          "codigo_principal",
          "descripcion",
          "cantidad",
          "precio_unitario",
          "id",
          "subtotal"
        ],
        "title": "DetalleNotaCreditoRead"
      },
      "DetalleProformaCreate": {
        "properties": {
          "codigo_principal": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo Principal"
          },
          "descripcion": {
            "type": "string",
            "maxLength": 300,
            "title": "Descripcion"
          },
          "cantidad": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Cantidad"
          },
          "precio_unitario": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio Unitario"
          },
          "descuento": {
            "type": "number",
            "minimum": 0.0,
            "title": "Descuento",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          }
        },
        "type": "object",
        "required": [
          "codigo_principal",
          "descripcion",
          "cantidad",
          "precio_unitario"
        ],
        "title": "DetalleProformaCreate"
      },
      "DetalleProformaRead": {
        "properties": {
          "codigo_principal": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo Principal"
          },
          "descripcion": {
            "type": "string",
            "maxLength": 300,
            "title": "Descripcion"
          },
          "cantidad": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Cantidad"
          },
          "precio_unitario": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio Unitario"
          },
          "descuento": {
            "type": "number",
            "minimum": 0.0,
            "title": "Descuento",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "subtotal": {
            "type": "number",
            "title": "Subtotal"
          }
        },
        "type": "object",
        "required": [
          "codigo_principal",
          "descripcion",
          "cantidad",
          "precio_unitario",
          "id",
          "subtotal"
        ],
        "title": "DetalleProformaRead"
      },
      "DocStatus": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "clave_acceso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clave Acceso"
          },
          "numero_autorizacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Numero Autorizacion"
          },
          "estado_sri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estado Sri"
          }
        },
        "type": "object",
        "required": [
          "id",
          "estado",
          "clave_acceso",
          "numero_autorizacion",
          "estado_sri"
        ],
        "title": "DocStatus",
        "description": "Estado de procesamiento de un comprobante (polling)."
      },
      "DocSustentoRetencionCreate": {
        "properties": {
          "cod_sustento": {
            "type": "string",
            "maxLength": 2,
            "title": "Cod Sustento",
            "default": "01"
          },
          "cod_doc_sustento": {
            "type": "string",
            "maxLength": 2,
            "title": "Cod Doc Sustento",
            "default": "01"
          },
          "num_doc_sustento": {
            "type": "string",
            "maxLength": 17,
            "title": "Num Doc Sustento"
          },
          "fecha_emision_sustento": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision Sustento"
          },
          "total_sin_impuestos": {
            "type": "number",
            "minimum": 0.0,
            "title": "Total Sin Impuestos"
          },
          "importe_total": {
            "type": "number",
            "minimum": 0.0,
            "title": "Importe Total"
          },
          "impuestos": {
            "items": {
              "$ref": "#/components/schemas/ImpuestoDocSustentoCreate"
            },
            "type": "array",
            "minItems": 1,
            "title": "Impuestos"
          },
          "lineas": {
            "items": {
              "$ref": "#/components/schemas/RetencionLineaCreate"
            },
            "type": "array",
            "minItems": 1,
            "title": "Lineas"
          }
        },
        "type": "object",
        "required": [
          "num_doc_sustento",
          "fecha_emision_sustento",
          "total_sin_impuestos",
          "importe_total",
          "impuestos",
          "lineas"
        ],
        "title": "DocSustentoRetencionCreate"
      },
      "EstadoCuentaLinea": {
        "properties": {
          "factura_id": {
            "type": "integer",
            "title": "Factura Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "fecha_vencimiento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Vencimiento"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "total_cobrado": {
            "type": "number",
            "title": "Total Cobrado"
          },
          "total_nc_aplicadas": {
            "type": "number",
            "title": "Total Nc Aplicadas"
          },
          "saldo": {
            "type": "number",
            "title": "Saldo"
          }
        },
        "type": "object",
        "required": [
          "factura_id",
          "numero_comprobante",
          "fecha_emision",
          "fecha_vencimiento",
          "total",
          "total_cobrado",
          "total_nc_aplicadas",
          "saldo"
        ],
        "title": "EstadoCuentaLinea"
      },
      "EstadoCuentaOut": {
        "properties": {
          "cliente_id": {
            "type": "integer",
            "title": "Cliente Id"
          },
          "cliente_razon_social": {
            "type": "string",
            "title": "Cliente Razon Social"
          },
          "cliente_identificacion": {
            "type": "string",
            "title": "Cliente Identificacion"
          },
          "lineas": {
            "items": {
              "$ref": "#/components/schemas/EstadoCuentaLinea"
            },
            "type": "array",
            "title": "Lineas"
          },
          "total_facturado": {
            "type": "number",
            "title": "Total Facturado"
          },
          "total_cobrado": {
            "type": "number",
            "title": "Total Cobrado"
          },
          "total_nc": {
            "type": "number",
            "title": "Total Nc"
          },
          "saldo_pendiente": {
            "type": "number",
            "title": "Saldo Pendiente"
          }
        },
        "type": "object",
        "required": [
          "cliente_id",
          "cliente_razon_social",
          "cliente_identificacion",
          "lineas",
          "total_facturado",
          "total_cobrado",
          "total_nc",
          "saldo_pendiente"
        ],
        "title": "EstadoCuentaOut"
      },
      "EstadoFactura": {
        "type": "string",
        "enum": [
          "BORRADOR",
          "PENDIENTE",
          "PROCESANDO",
          "EN_PROCESO",
          "AUTORIZADO",
          "ANULADO",
          "RECHAZADO",
          "DEVUELTA"
        ],
        "title": "EstadoFactura",
        "description": "Estado contable/operativo del comprobante en Emitoo."
      },
      "EventoRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "tenant_id": {
            "type": "integer",
            "title": "Tenant Id"
          },
          "nombre": {
            "type": "string",
            "title": "Nombre"
          },
          "documento_tipo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Documento Tipo"
          },
          "documento_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Documento Id"
          },
          "payload": {
            "additionalProperties": true,
            "type": "object",
            "title": "Payload"
          },
          "emitido_en": {
            "type": "string",
            "format": "date-time",
            "title": "Emitido En"
          }
        },
        "type": "object",
        "required": [
          "id",
          "tenant_id",
          "nombre",
          "documento_tipo",
          "documento_id",
          "payload",
          "emitido_en"
        ],
        "title": "EventoRead"
      },
      "FacturaCreate": {
        "properties": {
          "tipo_identificacion": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "identificacion": {
            "type": "string",
            "maxLength": 20,
            "title": "Identificacion"
          },
          "razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Razon Social"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "detalles": {
            "items": {
              "$ref": "#/components/schemas/DetalleFacturaCreate"
            },
            "type": "array",
            "minItems": 1,
            "title": "Detalles"
          },
          "sucursal_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sucursal Id"
          },
          "es_borrador": {
            "type": "boolean",
            "title": "Es Borrador",
            "default": false
          },
          "idempotency_key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotency Key"
          },
          "pagos": {
            "items": {
              "$ref": "#/components/schemas/FacturaPagoIn"
            },
            "type": "array",
            "title": "Pagos"
          },
          "condicion_pago": {
            "type": "string",
            "title": "Condicion Pago",
            "default": "contado"
          },
          "fecha_vencimiento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Vencimiento"
          }
        },
        "type": "object",
        "required": [
          "tipo_identificacion",
          "identificacion",
          "razon_social",
          "detalles"
        ],
        "title": "FacturaCreate",
        "description": "Payload que envía el frontend al emitir una factura."
      },
      "FacturaListItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "razon_social": {
            "type": "string",
            "title": "Razon Social"
          },
          "identificacion": {
            "type": "string",
            "title": "Identificacion"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "ambiente": {
            "type": "string",
            "title": "Ambiente",
            "default": "1"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "razon_social",
          "identificacion",
          "total",
          "estado"
        ],
        "title": "FacturaListItem",
        "description": "Fila compacta para la tabla del dashboard."
      },
      "FacturaPagoIn": {
        "properties": {
          "forma_pago": {
            "type": "string",
            "title": "Forma Pago"
          },
          "total": {
            "type": "number",
            "minimum": 0.0,
            "title": "Total"
          },
          "plazo": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Plazo"
          },
          "unidad_tiempo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unidad Tiempo"
          }
        },
        "type": "object",
        "required": [
          "forma_pago",
          "total"
        ],
        "title": "FacturaPagoIn",
        "description": "Una línea de pago de la factura (split). FormaPago = Tabla 24 SRI."
      },
      "FacturaPagoRead": {
        "properties": {
          "forma_pago": {
            "type": "string",
            "title": "Forma Pago"
          },
          "total": {
            "type": "number",
            "minimum": 0.0,
            "title": "Total"
          },
          "plazo": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Plazo"
          },
          "unidad_tiempo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unidad Tiempo"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          }
        },
        "type": "object",
        "required": [
          "forma_pago",
          "total",
          "id"
        ],
        "title": "FacturaPagoRead"
      },
      "FacturaRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "tipo_identificacion": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "identificacion": {
            "type": "string",
            "title": "Identificacion"
          },
          "razon_social": {
            "type": "string",
            "title": "Razon Social"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "subtotal_0": {
            "type": "number",
            "title": "Subtotal 0"
          },
          "subtotal_15": {
            "type": "number",
            "title": "Subtotal 15"
          },
          "iva": {
            "type": "number",
            "title": "Iva"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "condicion_pago": {
            "type": "string",
            "title": "Condicion Pago",
            "default": "contado"
          },
          "fecha_vencimiento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Vencimiento"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "clave_acceso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clave Acceso"
          },
          "numero_autorizacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Numero Autorizacion"
          },
          "fecha_autorizacion": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Autorizacion"
          },
          "estado_sri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estado Sri"
          },
          "anulado_motivo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Motivo"
          },
          "anulado_fecha": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Fecha"
          },
          "detalles": {
            "items": {
              "$ref": "#/components/schemas/DetalleFacturaRead"
            },
            "type": "array",
            "title": "Detalles"
          },
          "pagos": {
            "items": {
              "$ref": "#/components/schemas/FacturaPagoRead"
            },
            "type": "array",
            "title": "Pagos"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "tipo_identificacion",
          "identificacion",
          "razon_social",
          "direccion",
          "email",
          "subtotal_0",
          "subtotal_15",
          "iva",
          "total",
          "estado",
          "clave_acceso",
          "numero_autorizacion",
          "fecha_autorizacion",
          "estado_sri",
          "detalles"
        ],
        "title": "FacturaRead"
      },
      "FacturaStatus": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "clave_acceso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clave Acceso"
          },
          "numero_autorizacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Numero Autorizacion"
          },
          "fecha_autorizacion": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Autorizacion"
          },
          "estado_sri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estado Sri"
          }
        },
        "type": "object",
        "required": [
          "id",
          "estado",
          "clave_acceso",
          "numero_autorizacion",
          "fecha_autorizacion",
          "estado_sri"
        ],
        "title": "FacturaStatus",
        "description": "Respuesta del endpoint de polling del estado del SRI."
      },
      "GuiaRemisionCreate": {
        "properties": {
          "dir_partida": {
            "type": "string",
            "maxLength": 300,
            "title": "Dir Partida"
          },
          "transportista_tipo_id": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "transportista_identificacion": {
            "type": "string",
            "maxLength": 20,
            "title": "Transportista Identificacion"
          },
          "transportista_razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Transportista Razon Social"
          },
          "placa": {
            "type": "string",
            "maxLength": 20,
            "title": "Placa"
          },
          "fecha_ini_transporte": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Ini Transporte"
          },
          "fecha_fin_transporte": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Fin Transporte"
          },
          "destinatarios": {
            "items": {
              "$ref": "#/components/schemas/DestinatarioGuiaCreate"
            },
            "type": "array",
            "minItems": 1,
            "title": "Destinatarios"
          },
          "sucursal_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sucursal Id"
          },
          "es_borrador": {
            "type": "boolean",
            "title": "Es Borrador",
            "default": false
          },
          "idempotency_key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotency Key"
          }
        },
        "type": "object",
        "required": [
          "dir_partida",
          "transportista_tipo_id",
          "transportista_identificacion",
          "transportista_razon_social",
          "placa",
          "fecha_ini_transporte",
          "fecha_fin_transporte",
          "destinatarios"
        ],
        "title": "GuiaRemisionCreate"
      },
      "GuiaRemisionListItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "transportista_razon_social": {
            "type": "string",
            "title": "Transportista Razon Social"
          },
          "placa": {
            "type": "string",
            "title": "Placa"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "ambiente": {
            "type": "string",
            "title": "Ambiente",
            "default": "1"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "transportista_razon_social",
          "placa",
          "estado"
        ],
        "title": "GuiaRemisionListItem"
      },
      "GuiaRemisionRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "transportista_razon_social": {
            "type": "string",
            "title": "Transportista Razon Social"
          },
          "placa": {
            "type": "string",
            "title": "Placa"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "ambiente": {
            "type": "string",
            "title": "Ambiente",
            "default": "1"
          },
          "clave_acceso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clave Acceso"
          },
          "numero_autorizacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Numero Autorizacion"
          },
          "estado_sri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estado Sri"
          },
          "dir_partida": {
            "type": "string",
            "title": "Dir Partida"
          },
          "anulado_motivo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Motivo"
          },
          "anulado_fecha": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Fecha"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "transportista_razon_social",
          "placa",
          "estado",
          "clave_acceso",
          "numero_autorizacion",
          "estado_sri",
          "dir_partida"
        ],
        "title": "GuiaRemisionRead"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ImpuestoDocSustentoCreate": {
        "properties": {
          "cod_impuesto": {
            "type": "string",
            "maxLength": 2,
            "title": "Cod Impuesto",
            "default": "2"
          },
          "codigo_porcentaje": {
            "type": "string",
            "maxLength": 4,
            "title": "Codigo Porcentaje"
          },
          "base_imponible": {
            "type": "number",
            "minimum": 0.0,
            "title": "Base Imponible"
          },
          "tarifa": {
            "type": "number",
            "minimum": 0.0,
            "title": "Tarifa"
          }
        },
        "type": "object",
        "required": [
          "codigo_porcentaje",
          "base_imponible",
          "tarifa"
        ],
        "title": "ImpuestoDocSustentoCreate",
        "description": "Un impuesto del documento de sustento (bloque impuestoDocSustento, XSD 2.0.0)."
      },
      "LiquidacionCreate": {
        "properties": {
          "proveedor_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proveedor Id"
          },
          "proveedor_tipo_id": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "proveedor_identificacion": {
            "type": "string",
            "maxLength": 20,
            "title": "Proveedor Identificacion"
          },
          "proveedor_razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Proveedor Razon Social"
          },
          "proveedor_direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Proveedor Direccion"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "cod_doc_sustento": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2
              },
              {
                "type": "null"
              }
            ],
            "title": "Cod Doc Sustento"
          },
          "doc_sustento_numero": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 17
              },
              {
                "type": "null"
              }
            ],
            "title": "Doc Sustento Numero"
          },
          "doc_sustento_fecha": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doc Sustento Fecha"
          },
          "detalles": {
            "items": {
              "$ref": "#/components/schemas/DetalleLiquidacionCreate"
            },
            "type": "array",
            "minItems": 1,
            "title": "Detalles"
          },
          "pagos": {
            "items": {
              "$ref": "#/components/schemas/FacturaPagoIn"
            },
            "type": "array",
            "title": "Pagos"
          },
          "condicion_pago": {
            "type": "string",
            "title": "Condicion Pago",
            "default": "contado"
          },
          "fecha_vencimiento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Vencimiento"
          },
          "sucursal_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sucursal Id"
          },
          "es_borrador": {
            "type": "boolean",
            "title": "Es Borrador",
            "default": false
          },
          "idempotency_key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotency Key"
          }
        },
        "type": "object",
        "required": [
          "proveedor_tipo_id",
          "proveedor_identificacion",
          "proveedor_razon_social",
          "detalles"
        ],
        "title": "LiquidacionCreate",
        "description": "Payload para emitir una liquidación (Fase 1.4).\n\nLa emite el COMPRADOR (el tenant). El proveedor se selecciona/crea como\n`PersonaEmpresa` con `es_proveedor=True` (el flag YA existe; no se crea\nentidad nueva). Si `proveedor_id` viene, se tomarán los datos del catálogo;\nsi NO, los campos sueltos son obligatorios."
      },
      "LiquidacionListItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "proveedor_razon_social": {
            "type": "string",
            "title": "Proveedor Razon Social"
          },
          "proveedor_identificacion": {
            "type": "string",
            "title": "Proveedor Identificacion"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "ambiente": {
            "type": "string",
            "title": "Ambiente",
            "default": "1"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "proveedor_razon_social",
          "proveedor_identificacion",
          "total",
          "estado"
        ],
        "title": "LiquidacionListItem"
      },
      "LiquidacionRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "proveedor_razon_social": {
            "type": "string",
            "title": "Proveedor Razon Social"
          },
          "proveedor_identificacion": {
            "type": "string",
            "title": "Proveedor Identificacion"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "ambiente": {
            "type": "string",
            "title": "Ambiente",
            "default": "1"
          },
          "proveedor_tipo_id": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "proveedor_direccion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proveedor Direccion"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "cod_doc_sustento": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cod Doc Sustento"
          },
          "doc_sustento_numero": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doc Sustento Numero"
          },
          "doc_sustento_fecha": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doc Sustento Fecha"
          },
          "subtotal_0": {
            "type": "number",
            "title": "Subtotal 0"
          },
          "subtotal_15": {
            "type": "number",
            "title": "Subtotal 15"
          },
          "iva": {
            "type": "number",
            "title": "Iva"
          },
          "condicion_pago": {
            "type": "string",
            "title": "Condicion Pago",
            "default": "contado"
          },
          "fecha_vencimiento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Vencimiento"
          },
          "clave_acceso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clave Acceso"
          },
          "numero_autorizacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Numero Autorizacion"
          },
          "fecha_autorizacion": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Autorizacion"
          },
          "estado_sri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estado Sri"
          },
          "proveedor_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proveedor Id"
          },
          "anulado_motivo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Motivo"
          },
          "anulado_fecha": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Fecha"
          },
          "detalles": {
            "items": {
              "$ref": "#/components/schemas/DetalleLiquidacionRead"
            },
            "type": "array",
            "title": "Detalles"
          },
          "pagos": {
            "items": {
              "$ref": "#/components/schemas/FacturaPagoRead"
            },
            "type": "array",
            "title": "Pagos"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "proveedor_razon_social",
          "proveedor_identificacion",
          "total",
          "estado",
          "proveedor_tipo_id",
          "proveedor_direccion",
          "email",
          "cod_doc_sustento",
          "doc_sustento_numero",
          "doc_sustento_fecha",
          "subtotal_0",
          "subtotal_15",
          "iva",
          "clave_acceso",
          "numero_autorizacion",
          "fecha_autorizacion",
          "estado_sri",
          "proveedor_id"
        ],
        "title": "LiquidacionRead"
      },
      "LookupResult": {
        "properties": {
          "identificacion": {
            "type": "string",
            "title": "Identificacion"
          },
          "tipo_identificacion": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "razon_social": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Razon Social"
          },
          "nombre_comercial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre Comercial"
          },
          "estado_contribuyente": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estado Contribuyente"
          },
          "tipo_contribuyente": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tipo Contribuyente"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "encontrado": {
            "type": "boolean",
            "title": "Encontrado",
            "default": false
          },
          "fuente": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fuente"
          },
          "mensaje": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mensaje"
          }
        },
        "type": "object",
        "required": [
          "identificacion",
          "tipo_identificacion"
        ],
        "title": "LookupResult",
        "description": "Datos del contribuyente obtenidos del SRI por RUC/cédula."
      },
      "MotivoNotaDebitoIn": {
        "properties": {
          "razon": {
            "type": "string",
            "maxLength": 300,
            "title": "Razon"
          },
          "valor": {
            "type": "number",
            "minimum": 0.0,
            "title": "Valor"
          }
        },
        "type": "object",
        "required": [
          "razon",
          "valor"
        ],
        "title": "MotivoNotaDebitoIn",
        "description": "Una línea del bloque <motivos> (razón + valor)."
      },
      "MotivoNotaDebitoRead": {
        "properties": {
          "razon": {
            "type": "string",
            "maxLength": 300,
            "title": "Razon"
          },
          "valor": {
            "type": "number",
            "minimum": 0.0,
            "title": "Valor"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          }
        },
        "type": "object",
        "required": [
          "razon",
          "valor",
          "id"
        ],
        "title": "MotivoNotaDebitoRead"
      },
      "MovimientoDineroCreate": {
        "properties": {
          "tipo": {
            "type": "string",
            "title": "Tipo"
          },
          "monto": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Monto"
          },
          "fecha": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha"
          },
          "descripcion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Descripcion"
          }
        },
        "type": "object",
        "required": [
          "tipo",
          "monto",
          "fecha"
        ],
        "title": "MovimientoDineroCreate",
        "description": "Movimiento manual (POST /cuentas-dinero/{id}/movimientos)."
      },
      "MovimientoDineroRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "cuenta_id": {
            "type": "integer",
            "title": "Cuenta Id"
          },
          "fecha": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha"
          },
          "tipo": {
            "type": "string",
            "title": "Tipo"
          },
          "monto": {
            "type": "number",
            "title": "Monto"
          },
          "origen_tipo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Origen Tipo"
          },
          "origen_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Origen Id"
          },
          "descripcion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Descripcion"
          },
          "conciliado": {
            "type": "boolean",
            "title": "Conciliado"
          },
          "creado_en": {
            "type": "string",
            "format": "date-time",
            "title": "Creado En"
          }
        },
        "type": "object",
        "required": [
          "id",
          "cuenta_id",
          "fecha",
          "tipo",
          "monto",
          "origen_tipo",
          "origen_id",
          "descripcion",
          "conciliado",
          "creado_en"
        ],
        "title": "MovimientoDineroRead"
      },
      "NodeRunRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "run_id": {
            "type": "integer",
            "title": "Run Id"
          },
          "node_id": {
            "type": "string",
            "title": "Node Id"
          },
          "node_tipo": {
            "type": "string",
            "title": "Node Tipo"
          },
          "input": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input"
          },
          "output": {
            "additionalProperties": true,
            "type": "object",
            "title": "Output"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "estado": {
            "$ref": "#/components/schemas/NodeRunState"
          },
          "duracion_ms": {
            "type": "integer",
            "title": "Duracion Ms"
          },
          "orden": {
            "type": "integer",
            "title": "Orden"
          }
        },
        "type": "object",
        "required": [
          "id",
          "run_id",
          "node_id",
          "node_tipo",
          "input",
          "output",
          "error",
          "estado",
          "duracion_ms",
          "orden"
        ],
        "title": "NodeRunRead"
      },
      "NodeRunState": {
        "type": "string",
        "enum": [
          "pending",
          "running",
          "completed",
          "failed",
          "skipped"
        ],
        "title": "NodeRunState"
      },
      "NotaCreditoCreate": {
        "properties": {
          "tipo_identificacion": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "identificacion": {
            "type": "string",
            "maxLength": 20,
            "title": "Identificacion"
          },
          "razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Razon Social"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "factura_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Factura Id"
          },
          "cod_doc_sustento": {
            "type": "string",
            "maxLength": 2,
            "title": "Cod Doc Sustento",
            "default": "01"
          },
          "doc_sustento_numero": {
            "type": "string",
            "maxLength": 17,
            "title": "Doc Sustento Numero",
            "default": ""
          },
          "doc_sustento_fecha": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doc Sustento Fecha"
          },
          "motivo": {
            "type": "string",
            "maxLength": 300,
            "title": "Motivo"
          },
          "detalles": {
            "items": {
              "$ref": "#/components/schemas/DetalleNotaCreditoCreate"
            },
            "type": "array",
            "minItems": 1,
            "title": "Detalles"
          },
          "sucursal_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sucursal Id"
          },
          "es_borrador": {
            "type": "boolean",
            "title": "Es Borrador",
            "default": false
          },
          "idempotency_key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotency Key"
          }
        },
        "type": "object",
        "required": [
          "tipo_identificacion",
          "identificacion",
          "razon_social",
          "motivo",
          "detalles"
        ],
        "title": "NotaCreditoCreate",
        "description": "Payload de creación de una nota de crédito (Fase 1.2).\n\nReferencia una factura (local o externa) y opcionalmente líneas prellenadas.\nEl cliente (RUC/cédula) se puede COPIAR de la factura local referenciada\n(cuando `factura_id` viene) o ingresarse a mano (factura externa)."
      },
      "NotaCreditoListItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "razon_social": {
            "type": "string",
            "title": "Razon Social"
          },
          "identificacion": {
            "type": "string",
            "title": "Identificacion"
          },
          "doc_sustento_numero": {
            "type": "string",
            "title": "Doc Sustento Numero"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "ambiente": {
            "type": "string",
            "title": "Ambiente",
            "default": "1"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "razon_social",
          "identificacion",
          "doc_sustento_numero",
          "total",
          "estado"
        ],
        "title": "NotaCreditoListItem"
      },
      "NotaCreditoRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "razon_social": {
            "type": "string",
            "title": "Razon Social"
          },
          "identificacion": {
            "type": "string",
            "title": "Identificacion"
          },
          "doc_sustento_numero": {
            "type": "string",
            "title": "Doc Sustento Numero"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "ambiente": {
            "type": "string",
            "title": "Ambiente",
            "default": "1"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "cod_doc_sustento": {
            "type": "string",
            "title": "Cod Doc Sustento"
          },
          "doc_sustento_fecha": {
            "type": "string",
            "format": "date-time",
            "title": "Doc Sustento Fecha"
          },
          "motivo": {
            "type": "string",
            "title": "Motivo"
          },
          "subtotal_0": {
            "type": "number",
            "title": "Subtotal 0"
          },
          "subtotal_15": {
            "type": "number",
            "title": "Subtotal 15"
          },
          "iva": {
            "type": "number",
            "title": "Iva"
          },
          "clave_acceso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clave Acceso"
          },
          "numero_autorizacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Numero Autorizacion"
          },
          "fecha_autorizacion": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Autorizacion"
          },
          "estado_sri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estado Sri"
          },
          "factura_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Factura Id"
          },
          "anulado_motivo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Motivo"
          },
          "anulado_fecha": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Fecha"
          },
          "detalles": {
            "items": {
              "$ref": "#/components/schemas/DetalleNotaCreditoRead"
            },
            "type": "array",
            "title": "Detalles"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "razon_social",
          "identificacion",
          "doc_sustento_numero",
          "total",
          "estado",
          "direccion",
          "email",
          "cod_doc_sustento",
          "doc_sustento_fecha",
          "motivo",
          "subtotal_0",
          "subtotal_15",
          "iva",
          "clave_acceso",
          "numero_autorizacion",
          "fecha_autorizacion",
          "estado_sri",
          "factura_id"
        ],
        "title": "NotaCreditoRead"
      },
      "NotaDebitoCreate": {
        "properties": {
          "tipo_identificacion": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "identificacion": {
            "type": "string",
            "maxLength": 20,
            "title": "Identificacion"
          },
          "razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Razon Social"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "factura_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Factura Id"
          },
          "cod_doc_sustento": {
            "type": "string",
            "maxLength": 2,
            "title": "Cod Doc Sustento",
            "default": "01"
          },
          "doc_sustento_numero": {
            "type": "string",
            "maxLength": 17,
            "title": "Doc Sustento Numero",
            "default": ""
          },
          "doc_sustento_fecha": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doc Sustento Fecha"
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          },
          "motivos": {
            "items": {
              "$ref": "#/components/schemas/MotivoNotaDebitoIn"
            },
            "type": "array",
            "minItems": 1,
            "title": "Motivos"
          },
          "pagos": {
            "items": {
              "$ref": "#/components/schemas/NotaDebitoPagoIn"
            },
            "type": "array",
            "title": "Pagos"
          },
          "sucursal_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sucursal Id"
          },
          "es_borrador": {
            "type": "boolean",
            "title": "Es Borrador",
            "default": false
          },
          "idempotency_key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotency Key"
          }
        },
        "type": "object",
        "required": [
          "tipo_identificacion",
          "identificacion",
          "razon_social",
          "motivos"
        ],
        "title": "NotaDebitoCreate",
        "description": "Payload de creación de una nota de débito (Fase 1.3).\n\nEstructura más simple que la NC: en vez de líneas de productos, una lista\nde motivos {razon, valor} con UN SOLO codigoPorcentaje de IVA aplicado al\ntotal."
      },
      "NotaDebitoListItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "razon_social": {
            "type": "string",
            "title": "Razon Social"
          },
          "identificacion": {
            "type": "string",
            "title": "Identificacion"
          },
          "doc_sustento_numero": {
            "type": "string",
            "title": "Doc Sustento Numero"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "ambiente": {
            "type": "string",
            "title": "Ambiente",
            "default": "1"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "razon_social",
          "identificacion",
          "doc_sustento_numero",
          "total",
          "estado"
        ],
        "title": "NotaDebitoListItem"
      },
      "NotaDebitoPagoIn": {
        "properties": {
          "forma_pago": {
            "type": "string",
            "title": "Forma Pago"
          },
          "total": {
            "type": "number",
            "minimum": 0.0,
            "title": "Total"
          },
          "plazo": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Plazo"
          },
          "unidad_tiempo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unidad Tiempo"
          }
        },
        "type": "object",
        "required": [
          "forma_pago",
          "total"
        ],
        "title": "NotaDebitoPagoIn",
        "description": "Línea de pago (mismo shape que FacturaPagoIn)."
      },
      "NotaDebitoPagoRead": {
        "properties": {
          "forma_pago": {
            "type": "string",
            "title": "Forma Pago"
          },
          "total": {
            "type": "number",
            "minimum": 0.0,
            "title": "Total"
          },
          "plazo": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Plazo"
          },
          "unidad_tiempo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unidad Tiempo"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          }
        },
        "type": "object",
        "required": [
          "forma_pago",
          "total",
          "id"
        ],
        "title": "NotaDebitoPagoRead"
      },
      "NotaDebitoRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "razon_social": {
            "type": "string",
            "title": "Razon Social"
          },
          "identificacion": {
            "type": "string",
            "title": "Identificacion"
          },
          "doc_sustento_numero": {
            "type": "string",
            "title": "Doc Sustento Numero"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "ambiente": {
            "type": "string",
            "title": "Ambiente",
            "default": "1"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "cod_doc_sustento": {
            "type": "string",
            "title": "Cod Doc Sustento"
          },
          "doc_sustento_fecha": {
            "type": "string",
            "format": "date-time",
            "title": "Doc Sustento Fecha"
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva"
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          },
          "base_imponible": {
            "type": "number",
            "title": "Base Imponible"
          },
          "iva": {
            "type": "number",
            "title": "Iva"
          },
          "clave_acceso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clave Acceso"
          },
          "numero_autorizacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Numero Autorizacion"
          },
          "fecha_autorizacion": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Autorizacion"
          },
          "estado_sri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estado Sri"
          },
          "factura_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Factura Id"
          },
          "anulado_motivo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Motivo"
          },
          "anulado_fecha": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Fecha"
          },
          "motivos": {
            "items": {
              "$ref": "#/components/schemas/MotivoNotaDebitoRead"
            },
            "type": "array",
            "title": "Motivos"
          },
          "pagos": {
            "items": {
              "$ref": "#/components/schemas/NotaDebitoPagoRead"
            },
            "type": "array",
            "title": "Pagos"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "razon_social",
          "identificacion",
          "doc_sustento_numero",
          "total",
          "estado",
          "direccion",
          "email",
          "cod_doc_sustento",
          "doc_sustento_fecha",
          "tarifa_iva",
          "iva_codigo",
          "base_imponible",
          "iva",
          "clave_acceso",
          "numero_autorizacion",
          "fecha_autorizacion",
          "estado_sri",
          "factura_id"
        ],
        "title": "NotaDebitoRead"
      },
      "OnboardingRequest": {
        "properties": {
          "empresa_ruc": {
            "type": "string",
            "maxLength": 13,
            "title": "Empresa Ruc"
          },
          "empresa_razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Empresa Razon Social"
          },
          "empresa_nombre_comercial": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Empresa Nombre Comercial"
          },
          "empresa_direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Empresa Direccion"
          },
          "admin_nombre": {
            "type": "string",
            "maxLength": 200,
            "title": "Admin Nombre"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "recaptcha_token": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "title": "Recaptcha Token"
          }
        },
        "type": "object",
        "required": [
          "empresa_ruc",
          "empresa_razon_social",
          "admin_nombre"
        ],
        "title": "OnboardingRequest",
        "description": "Auto-registro público: el usuario YA se autenticó en Firebase (Bearer);\naquí crea su empresa (tenant) y queda como admin."
      },
      "OnboardingResult": {
        "properties": {
          "tenant_id": {
            "type": "integer",
            "title": "Tenant Id"
          },
          "user_id": {
            "type": "integer",
            "title": "User Id"
          },
          "role": {
            "type": "string",
            "title": "Role"
          }
        },
        "type": "object",
        "required": [
          "tenant_id",
          "user_id",
          "role"
        ],
        "title": "OnboardingResult"
      },
      "PagoAplicacionIn": {
        "properties": {
          "compra_id": {
            "type": "integer",
            "title": "Compra Id"
          },
          "monto_aplicado": {
            "type": "number",
            "minimum": 0.0,
            "title": "Monto Aplicado"
          }
        },
        "type": "object",
        "required": [
          "compra_id",
          "monto_aplicado"
        ],
        "title": "PagoAplicacionIn"
      },
      "PagoAplicacionRead": {
        "properties": {
          "compra_id": {
            "type": "integer",
            "title": "Compra Id"
          },
          "monto_aplicado": {
            "type": "number",
            "minimum": 0.0,
            "title": "Monto Aplicado"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          }
        },
        "type": "object",
        "required": [
          "compra_id",
          "monto_aplicado",
          "id"
        ],
        "title": "PagoAplicacionRead"
      },
      "PagoProveedorAnularIn": {
        "properties": {
          "motivo": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "Motivo"
          }
        },
        "type": "object",
        "required": [
          "motivo"
        ],
        "title": "PagoProveedorAnularIn"
      },
      "PagoProveedorCreate": {
        "properties": {
          "proveedor_id": {
            "type": "integer",
            "title": "Proveedor Id"
          },
          "fecha": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha"
          },
          "medio": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "title": "Medio"
          },
          "monto": {
            "type": "number",
            "minimum": 0.0,
            "title": "Monto"
          },
          "referencia": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Referencia"
          },
          "notas": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notas"
          },
          "cuenta_dinero_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cuenta Dinero Id"
          },
          "aplicaciones": {
            "items": {
              "$ref": "#/components/schemas/PagoAplicacionIn"
            },
            "type": "array",
            "minItems": 1,
            "title": "Aplicaciones"
          },
          "sucursal_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sucursal Id"
          }
        },
        "type": "object",
        "required": [
          "proveedor_id",
          "fecha",
          "medio",
          "monto",
          "aplicaciones"
        ],
        "title": "PagoProveedorCreate"
      },
      "PagoProveedorListItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "fecha": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha"
          },
          "proveedor_id": {
            "type": "integer",
            "title": "Proveedor Id"
          },
          "medio": {
            "type": "string",
            "title": "Medio"
          },
          "monto": {
            "type": "number",
            "title": "Monto"
          },
          "referencia": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Referencia"
          },
          "notas": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notas"
          },
          "cuenta_dinero_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cuenta Dinero Id"
          },
          "anulado": {
            "type": "boolean",
            "title": "Anulado",
            "default": false
          },
          "anulado_motivo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Motivo"
          },
          "anulado_en": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado En"
          }
        },
        "type": "object",
        "required": [
          "id",
          "fecha",
          "proveedor_id",
          "medio",
          "monto",
          "referencia",
          "notas",
          "cuenta_dinero_id"
        ],
        "title": "PagoProveedorListItem"
      },
      "PagoProveedorRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "fecha": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha"
          },
          "proveedor_id": {
            "type": "integer",
            "title": "Proveedor Id"
          },
          "medio": {
            "type": "string",
            "title": "Medio"
          },
          "monto": {
            "type": "number",
            "title": "Monto"
          },
          "referencia": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Referencia"
          },
          "notas": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notas"
          },
          "cuenta_dinero_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cuenta Dinero Id"
          },
          "anulado": {
            "type": "boolean",
            "title": "Anulado",
            "default": false
          },
          "anulado_motivo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Motivo"
          },
          "anulado_en": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado En"
          },
          "creado_en": {
            "type": "string",
            "format": "date-time",
            "title": "Creado En"
          },
          "aplicaciones": {
            "items": {
              "$ref": "#/components/schemas/PagoAplicacionRead"
            },
            "type": "array",
            "title": "Aplicaciones"
          }
        },
        "type": "object",
        "required": [
          "id",
          "fecha",
          "proveedor_id",
          "medio",
          "monto",
          "referencia",
          "notas",
          "cuenta_dinero_id",
          "creado_en"
        ],
        "title": "PagoProveedorRead"
      },
      "PersonaEmpresaCreate": {
        "properties": {
          "tipo_identificacion": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "identificacion": {
            "type": "string",
            "maxLength": 20,
            "title": "Identificacion"
          },
          "razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Razon Social"
          },
          "nombre_comercial": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre Comercial"
          },
          "telefono": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Telefono"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "es_cliente": {
            "type": "boolean",
            "title": "Es Cliente",
            "default": true
          },
          "es_proveedor": {
            "type": "boolean",
            "title": "Es Proveedor",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "tipo_identificacion",
          "identificacion",
          "razon_social"
        ],
        "title": "PersonaEmpresaCreate"
      },
      "PersonaEmpresaRead": {
        "properties": {
          "tipo_identificacion": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "identificacion": {
            "type": "string",
            "maxLength": 20,
            "title": "Identificacion"
          },
          "razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Razon Social"
          },
          "nombre_comercial": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre Comercial"
          },
          "telefono": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Telefono"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "es_cliente": {
            "type": "boolean",
            "title": "Es Cliente",
            "default": true
          },
          "es_proveedor": {
            "type": "boolean",
            "title": "Es Proveedor",
            "default": false
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo"
          }
        },
        "type": "object",
        "required": [
          "tipo_identificacion",
          "identificacion",
          "razon_social",
          "id",
          "activo"
        ],
        "title": "PersonaEmpresaRead"
      },
      "PersonaEmpresaUpdate": {
        "properties": {
          "tipo_identificacion": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "identificacion": {
            "type": "string",
            "maxLength": 20,
            "title": "Identificacion"
          },
          "razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Razon Social"
          },
          "nombre_comercial": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre Comercial"
          },
          "telefono": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Telefono"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "es_cliente": {
            "type": "boolean",
            "title": "Es Cliente",
            "default": true
          },
          "es_proveedor": {
            "type": "boolean",
            "title": "Es Proveedor",
            "default": false
          },
          "activo": {
            "type": "boolean",
            "title": "Activo",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "tipo_identificacion",
          "identificacion",
          "razon_social"
        ],
        "title": "PersonaEmpresaUpdate"
      },
      "PrincipalInfo": {
        "properties": {
          "tipo": {
            "type": "string",
            "title": "Tipo"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "es_superadmin": {
            "type": "boolean",
            "title": "Es Superadmin"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          },
          "sucursal_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Sucursal Ids",
            "default": []
          },
          "must_change_password": {
            "type": "boolean",
            "title": "Must Change Password",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "tipo",
          "id",
          "label",
          "role",
          "es_superadmin"
        ],
        "title": "PrincipalInfo"
      },
      "ProformaCreate": {
        "properties": {
          "tipo_identificacion": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "identificacion": {
            "type": "string",
            "maxLength": 20,
            "title": "Identificacion"
          },
          "razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Razon Social"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "validez_dias": {
            "type": "integer",
            "maximum": 365.0,
            "minimum": 1.0,
            "title": "Validez Dias",
            "default": 15
          },
          "notas": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notas"
          },
          "detalles": {
            "items": {
              "$ref": "#/components/schemas/DetalleProformaCreate"
            },
            "type": "array",
            "minItems": 1,
            "title": "Detalles"
          },
          "sucursal_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sucursal Id"
          },
          "es_borrador": {
            "type": "boolean",
            "title": "Es Borrador",
            "default": false
          },
          "idempotency_key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotency Key"
          }
        },
        "type": "object",
        "required": [
          "tipo_identificacion",
          "identificacion",
          "razon_social",
          "detalles"
        ],
        "title": "ProformaCreate",
        "description": "Payload para crear/emitir una proforma (Fase 1.5)."
      },
      "ProformaEstadoUpdate": {
        "properties": {
          "estado": {
            "type": "string",
            "title": "Estado"
          }
        },
        "type": "object",
        "required": [
          "estado"
        ],
        "title": "ProformaEstadoUpdate",
        "description": "Body simple para cambiar manualmente el estado (admin)."
      },
      "ProformaListItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "razon_social": {
            "type": "string",
            "title": "Razon Social"
          },
          "identificacion": {
            "type": "string",
            "title": "Identificacion"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "estado": {
            "type": "string",
            "title": "Estado"
          },
          "fecha_vencimiento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Vencimiento"
          },
          "factura_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Factura Id"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "razon_social",
          "identificacion",
          "total",
          "estado",
          "fecha_vencimiento",
          "factura_id"
        ],
        "title": "ProformaListItem"
      },
      "ProformaRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "razon_social": {
            "type": "string",
            "title": "Razon Social"
          },
          "identificacion": {
            "type": "string",
            "title": "Identificacion"
          },
          "total": {
            "type": "number",
            "title": "Total"
          },
          "estado": {
            "type": "string",
            "title": "Estado"
          },
          "fecha_vencimiento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Vencimiento"
          },
          "factura_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Factura Id"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "subtotal_0": {
            "type": "number",
            "title": "Subtotal 0"
          },
          "subtotal_15": {
            "type": "number",
            "title": "Subtotal 15"
          },
          "iva": {
            "type": "number",
            "title": "Iva"
          },
          "notas": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notas"
          },
          "token_publico": {
            "type": "string",
            "title": "Token Publico"
          },
          "detalles": {
            "items": {
              "$ref": "#/components/schemas/DetalleProformaRead"
            },
            "type": "array",
            "title": "Detalles"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "razon_social",
          "identificacion",
          "total",
          "estado",
          "fecha_vencimiento",
          "factura_id",
          "direccion",
          "email",
          "subtotal_0",
          "subtotal_15",
          "iva",
          "notas",
          "token_publico"
        ],
        "title": "ProformaRead"
      },
      "RetencionCreate": {
        "properties": {
          "sujeto_tipo_id": {
            "$ref": "#/components/schemas/TipoIdentificacion"
          },
          "sujeto_identificacion": {
            "type": "string",
            "maxLength": 20,
            "title": "Sujeto Identificacion"
          },
          "sujeto_razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Sujeto Razon Social"
          },
          "periodo_fiscal": {
            "type": "string",
            "pattern": "^(0[1-9]|1[0-2])/20[0-9]{2}$",
            "title": "Periodo Fiscal"
          },
          "parte_rel": {
            "type": "string",
            "pattern": "^(SI|NO)$",
            "title": "Parte Rel",
            "default": "NO"
          },
          "docs_sustento": {
            "items": {
              "$ref": "#/components/schemas/DocSustentoRetencionCreate"
            },
            "type": "array",
            "minItems": 1,
            "title": "Docs Sustento"
          },
          "sucursal_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sucursal Id"
          },
          "es_borrador": {
            "type": "boolean",
            "title": "Es Borrador",
            "default": false
          },
          "idempotency_key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotency Key"
          }
        },
        "type": "object",
        "required": [
          "sujeto_tipo_id",
          "sujeto_identificacion",
          "sujeto_razon_social",
          "periodo_fiscal",
          "docs_sustento"
        ],
        "title": "RetencionCreate"
      },
      "RetencionLineaCreate": {
        "properties": {
          "codigo": {
            "type": "string",
            "maxLength": 1,
            "title": "Codigo"
          },
          "codigo_retencion": {
            "type": "string",
            "maxLength": 5,
            "title": "Codigo Retencion"
          },
          "base_imponible": {
            "type": "number",
            "minimum": 0.0,
            "title": "Base Imponible"
          },
          "porcentaje": {
            "type": "number",
            "minimum": 0.0,
            "title": "Porcentaje"
          }
        },
        "type": "object",
        "required": [
          "codigo",
          "codigo_retencion",
          "base_imponible",
          "porcentaje"
        ],
        "title": "RetencionLineaCreate"
      },
      "RetencionListItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "sujeto_razon_social": {
            "type": "string",
            "title": "Sujeto Razon Social"
          },
          "sujeto_identificacion": {
            "type": "string",
            "title": "Sujeto Identificacion"
          },
          "total_retenido": {
            "type": "number",
            "title": "Total Retenido"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "ambiente": {
            "type": "string",
            "title": "Ambiente",
            "default": "1"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "sujeto_razon_social",
          "sujeto_identificacion",
          "total_retenido",
          "estado"
        ],
        "title": "RetencionListItem"
      },
      "RetencionRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "numero_comprobante": {
            "type": "string",
            "title": "Numero Comprobante"
          },
          "fecha_emision": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha Emision"
          },
          "sujeto_razon_social": {
            "type": "string",
            "title": "Sujeto Razon Social"
          },
          "sujeto_identificacion": {
            "type": "string",
            "title": "Sujeto Identificacion"
          },
          "total_retenido": {
            "type": "number",
            "title": "Total Retenido"
          },
          "estado": {
            "$ref": "#/components/schemas/EstadoFactura"
          },
          "ambiente": {
            "type": "string",
            "title": "Ambiente",
            "default": "1"
          },
          "clave_acceso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clave Acceso"
          },
          "numero_autorizacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Numero Autorizacion"
          },
          "estado_sri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estado Sri"
          },
          "periodo_fiscal": {
            "type": "string",
            "title": "Periodo Fiscal"
          },
          "anulado_motivo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Motivo"
          },
          "anulado_fecha": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anulado Fecha"
          }
        },
        "type": "object",
        "required": [
          "id",
          "numero_comprobante",
          "fecha_emision",
          "sujeto_razon_social",
          "sujeto_identificacion",
          "total_retenido",
          "estado",
          "clave_acceso",
          "numero_autorizacion",
          "estado_sri",
          "periodo_fiscal"
        ],
        "title": "RetencionRead"
      },
      "SecuenciaRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "ambiente": {
            "type": "string",
            "title": "Ambiente"
          },
          "establecimiento": {
            "type": "string",
            "title": "Establecimiento"
          },
          "punto_emision": {
            "type": "string",
            "title": "Punto Emision"
          },
          "cod_doc": {
            "type": "string",
            "title": "Cod Doc"
          },
          "siguiente": {
            "type": "integer",
            "title": "Siguiente"
          }
        },
        "type": "object",
        "required": [
          "id",
          "ambiente",
          "establecimiento",
          "punto_emision",
          "cod_doc",
          "siguiente"
        ],
        "title": "SecuenciaRead"
      },
      "SecuenciaUpdate": {
        "properties": {
          "ambiente": {
            "type": "string",
            "maxLength": 1,
            "title": "Ambiente",
            "default": "1"
          },
          "establecimiento": {
            "type": "string",
            "maxLength": 3,
            "title": "Establecimiento"
          },
          "punto_emision": {
            "type": "string",
            "maxLength": 3,
            "title": "Punto Emision"
          },
          "cod_doc": {
            "type": "string",
            "maxLength": 2,
            "title": "Cod Doc"
          },
          "siguiente": {
            "type": "integer",
            "minimum": 1.0,
            "title": "Siguiente"
          }
        },
        "type": "object",
        "required": [
          "establecimiento",
          "punto_emision",
          "cod_doc",
          "siguiente"
        ],
        "title": "SecuenciaUpdate"
      },
      "ServicioCreate": {
        "properties": {
          "codigo": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo"
          },
          "nombre": {
            "type": "string",
            "maxLength": 300,
            "title": "Nombre"
          },
          "descripcion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Descripcion"
          },
          "tipo": {
            "$ref": "#/components/schemas/TipoProducto",
            "default": "SER"
          },
          "precio": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          },
          "precio_variable": {
            "type": "boolean",
            "title": "Precio Variable",
            "default": false
          },
          "categoria": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Categoria"
          }
        },
        "type": "object",
        "required": [
          "codigo",
          "nombre"
        ],
        "title": "ServicioCreate"
      },
      "ServicioRead": {
        "properties": {
          "codigo": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo"
          },
          "nombre": {
            "type": "string",
            "maxLength": 300,
            "title": "Nombre"
          },
          "descripcion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Descripcion"
          },
          "tipo": {
            "$ref": "#/components/schemas/TipoProducto",
            "default": "SER"
          },
          "precio": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          },
          "precio_variable": {
            "type": "boolean",
            "title": "Precio Variable",
            "default": false
          },
          "categoria": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Categoria"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo"
          }
        },
        "type": "object",
        "required": [
          "codigo",
          "nombre",
          "id",
          "activo"
        ],
        "title": "ServicioRead"
      },
      "ServicioUpdate": {
        "properties": {
          "codigo": {
            "type": "string",
            "maxLength": 25,
            "title": "Codigo"
          },
          "nombre": {
            "type": "string",
            "maxLength": 300,
            "title": "Nombre"
          },
          "descripcion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Descripcion"
          },
          "tipo": {
            "$ref": "#/components/schemas/TipoProducto",
            "default": "SER"
          },
          "precio": {
            "type": "number",
            "minimum": 0.0,
            "title": "Precio",
            "default": 0
          },
          "tarifa_iva": {
            "type": "integer",
            "title": "Tarifa Iva",
            "default": 15
          },
          "iva_codigo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iva Codigo"
          },
          "precio_variable": {
            "type": "boolean",
            "title": "Precio Variable",
            "default": false
          },
          "categoria": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Categoria"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "codigo",
          "nombre"
        ],
        "title": "ServicioUpdate"
      },
      "SmtpTestRequest": {
        "properties": {
          "to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "To"
          }
        },
        "type": "object",
        "title": "SmtpTestRequest"
      },
      "SriHealth": {
        "properties": {
          "worker_vivo": {
            "type": "boolean",
            "title": "Worker Vivo"
          },
          "worker_ultimo_latido_seg": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Worker Ultimo Latido Seg"
          },
          "backlog_due": {
            "type": "integer",
            "title": "Backlog Due",
            "default": 0
          },
          "bloqueados_config": {
            "type": "integer",
            "title": "Bloqueados Config",
            "default": 0
          },
          "pendientes": {
            "type": "integer",
            "title": "Pendientes",
            "default": 0
          },
          "procesando": {
            "type": "integer",
            "title": "Procesando",
            "default": 0
          },
          "en_proceso": {
            "type": "integer",
            "title": "En Proceso",
            "default": 0
          },
          "mas_antiguo_pendiente_seg": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mas Antiguo Pendiente Seg"
          },
          "autorizados_24h": {
            "type": "integer",
            "title": "Autorizados 24H",
            "default": 0
          },
          "rechazados_24h": {
            "type": "integer",
            "title": "Rechazados 24H",
            "default": 0
          },
          "devueltas_24h": {
            "type": "integer",
            "title": "Devueltas 24H",
            "default": 0
          },
          "senal": {
            "type": "string",
            "title": "Senal",
            "default": "ok"
          },
          "detalle": {
            "type": "string",
            "title": "Detalle",
            "default": ""
          },
          "por_tipo": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SriHealthTipo"
            },
            "type": "object",
            "title": "Por Tipo"
          }
        },
        "type": "object",
        "required": [
          "worker_vivo"
        ],
        "title": "SriHealth"
      },
      "SriHealthTipo": {
        "properties": {
          "pendiente": {
            "type": "integer",
            "title": "Pendiente",
            "default": 0
          },
          "procesando": {
            "type": "integer",
            "title": "Procesando",
            "default": 0
          },
          "en_proceso": {
            "type": "integer",
            "title": "En Proceso",
            "default": 0
          },
          "autorizados_24h": {
            "type": "integer",
            "title": "Autorizados 24H",
            "default": 0
          },
          "rechazados_24h": {
            "type": "integer",
            "title": "Rechazados 24H",
            "default": 0
          },
          "devueltas_24h": {
            "type": "integer",
            "title": "Devueltas 24H",
            "default": 0
          }
        },
        "type": "object",
        "title": "SriHealthTipo"
      },
      "SucursalCreate": {
        "properties": {
          "codigo": {
            "type": "string",
            "pattern": "^[0-9]{3}$",
            "title": "Codigo"
          },
          "nombre": {
            "type": "string",
            "maxLength": 200,
            "title": "Nombre"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "punto_emision": {
            "type": "string",
            "pattern": "^[0-9]{3}$",
            "title": "Punto Emision",
            "default": "001"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          }
        },
        "type": "object",
        "required": [
          "codigo",
          "nombre"
        ],
        "title": "SucursalCreate"
      },
      "SucursalRead": {
        "properties": {
          "codigo": {
            "type": "string",
            "pattern": "^[0-9]{3}$",
            "title": "Codigo"
          },
          "nombre": {
            "type": "string",
            "maxLength": 200,
            "title": "Nombre"
          },
          "direccion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Direccion"
          },
          "punto_emision": {
            "type": "string",
            "pattern": "^[0-9]{3}$",
            "title": "Punto Emision",
            "default": "001"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "tenant_id": {
            "type": "integer",
            "title": "Tenant Id"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo"
          }
        },
        "type": "object",
        "required": [
          "codigo",
          "nombre",
          "id",
          "tenant_id",
          "activo"
        ],
        "title": "SucursalRead"
      },
      "TenantCreate": {
        "properties": {
          "ruc": {
            "type": "string",
            "maxLength": 13,
            "title": "Ruc"
          },
          "razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Razon Social"
          },
          "nombre_comercial": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre Comercial"
          },
          "dir_matriz": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Dir Matriz"
          },
          "dir_establecimiento": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Dir Establecimiento"
          }
        },
        "type": "object",
        "required": [
          "ruc",
          "razon_social"
        ],
        "title": "TenantCreate"
      },
      "TenantRead": {
        "properties": {
          "ruc": {
            "type": "string",
            "maxLength": 13,
            "title": "Ruc"
          },
          "razon_social": {
            "type": "string",
            "maxLength": 300,
            "title": "Razon Social"
          },
          "nombre_comercial": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre Comercial"
          },
          "dir_matriz": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Dir Matriz"
          },
          "dir_establecimiento": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Dir Establecimiento"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo"
          }
        },
        "type": "object",
        "required": [
          "ruc",
          "razon_social",
          "id",
          "activo"
        ],
        "title": "TenantRead"
      },
      "TipoIdentificacion": {
        "type": "string",
        "enum": [
          "04",
          "05",
          "06",
          "07",
          "08"
        ],
        "title": "TipoIdentificacion",
        "description": "Códigos de tipo de identificación del comprador (ficha técnica SRI)."
      },
      "TipoProducto": {
        "type": "string",
        "enum": [
          "PRO",
          "SER"
        ],
        "title": "TipoProducto"
      },
      "TransferenciaCreate": {
        "properties": {
          "origen_id": {
            "type": "integer",
            "title": "Origen Id"
          },
          "destino_id": {
            "type": "integer",
            "title": "Destino Id"
          },
          "monto": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Monto"
          },
          "fecha": {
            "type": "string",
            "format": "date-time",
            "title": "Fecha"
          },
          "descripcion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Descripcion"
          }
        },
        "type": "object",
        "required": [
          "origen_id",
          "destino_id",
          "monto",
          "fecha"
        ],
        "title": "TransferenciaCreate"
      },
      "UserCreate": {
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 200,
            "title": "Email"
          },
          "nombre": {
            "type": "string",
            "maxLength": 200,
            "title": "Nombre"
          },
          "role": {
            "type": "string",
            "maxLength": 30,
            "title": "Role"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          },
          "uuid": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "title": "Uuid"
          },
          "sucursal_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Sucursal Ids",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "email",
          "nombre",
          "role"
        ],
        "title": "UserCreate"
      },
      "UserRead": {
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 200,
            "title": "Email"
          },
          "nombre": {
            "type": "string",
            "maxLength": 200,
            "title": "Nombre"
          },
          "role": {
            "type": "string",
            "maxLength": 30,
            "title": "Role"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo"
          },
          "must_change_password": {
            "type": "boolean",
            "title": "Must Change Password",
            "default": false
          },
          "sucursal_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Sucursal Ids",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "email",
          "nombre",
          "role",
          "id",
          "activo"
        ],
        "title": "UserRead"
      },
      "UserUpdate": {
        "properties": {
          "nombre": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          },
          "activo": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Activo"
          },
          "sucursal_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sucursal Ids"
          }
        },
        "type": "object",
        "title": "UserUpdate"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "WebhookCreate": {
        "properties": {
          "nombre": {
            "type": "string",
            "maxLength": 120,
            "title": "Nombre"
          },
          "url": {
            "type": "string",
            "maxLength": 500,
            "title": "Url"
          },
          "eventos": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Eventos"
          },
          "secret": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "nombre",
          "url"
        ],
        "title": "WebhookCreate"
      },
      "WebhookCreated": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "nombre": {
            "type": "string",
            "title": "Nombre"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "eventos": {
            "type": "string",
            "title": "Eventos"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "secret": {
            "type": "string",
            "title": "Secret"
          }
        },
        "type": "object",
        "required": [
          "id",
          "nombre",
          "url",
          "eventos",
          "activo",
          "created_at",
          "secret"
        ],
        "title": "WebhookCreated",
        "description": "Respuesta al crear/regenerar: incluye el secret una sola vez."
      },
      "WebhookDeliveryRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "webhook_id": {
            "type": "integer",
            "title": "Webhook Id"
          },
          "delivery_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Id"
          },
          "evento": {
            "type": "string",
            "title": "Evento"
          },
          "estado": {
            "type": "string",
            "title": "Estado"
          },
          "proximo_intento": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proximo Intento"
          },
          "status_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Code"
          },
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "intento": {
            "type": "integer",
            "title": "Intento"
          },
          "detalle": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detalle"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "webhook_id",
          "evento",
          "estado",
          "status_code",
          "ok",
          "intento",
          "detalle",
          "created_at"
        ],
        "title": "WebhookDeliveryRead"
      },
      "WebhookRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "nombre": {
            "type": "string",
            "title": "Nombre"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "eventos": {
            "type": "string",
            "title": "Eventos"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "nombre",
          "url",
          "eventos",
          "activo",
          "created_at"
        ],
        "title": "WebhookRead"
      },
      "WebhookUpdate": {
        "properties": {
          "nombre": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "eventos": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Eventos"
          },
          "activo": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Activo"
          }
        },
        "type": "object",
        "title": "WebhookUpdate"
      },
      "WorkflowCreate": {
        "properties": {
          "nombre": {
            "type": "string",
            "maxLength": 160,
            "title": "Nombre"
          },
          "descripcion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Descripcion"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo",
            "default": true
          },
          "trigger_tipo": {
            "$ref": "#/components/schemas/WorkflowTrigger"
          },
          "cron_expr": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cron Expr"
          },
          "evento": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evento"
          },
          "definicion": {
            "additionalProperties": true,
            "type": "object",
            "title": "Definicion"
          }
        },
        "type": "object",
        "required": [
          "nombre",
          "trigger_tipo"
        ],
        "title": "WorkflowCreate"
      },
      "WorkflowRead": {
        "properties": {
          "nombre": {
            "type": "string",
            "maxLength": 160,
            "title": "Nombre"
          },
          "descripcion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Descripcion"
          },
          "activo": {
            "type": "boolean",
            "title": "Activo",
            "default": true
          },
          "trigger_tipo": {
            "$ref": "#/components/schemas/WorkflowTrigger"
          },
          "cron_expr": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cron Expr"
          },
          "evento": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evento"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "tenant_id": {
            "type": "integer",
            "title": "Tenant Id"
          },
          "definicion": {
            "additionalProperties": true,
            "type": "object",
            "title": "Definicion"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "nombre",
          "trigger_tipo",
          "id",
          "tenant_id",
          "definicion",
          "created_at",
          "updated_at"
        ],
        "title": "WorkflowRead"
      },
      "WorkflowRunRead": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "workflow_id": {
            "type": "integer",
            "title": "Workflow Id"
          },
          "trigger": {
            "type": "string",
            "title": "Trigger"
          },
          "payload": {
            "additionalProperties": true,
            "type": "object",
            "title": "Payload"
          },
          "estado": {
            "$ref": "#/components/schemas/WorkflowRunState"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "completado_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completado At"
          },
          "nodes": {
            "items": {
              "$ref": "#/components/schemas/NodeRunRead"
            },
            "type": "array",
            "title": "Nodes"
          }
        },
        "type": "object",
        "required": [
          "id",
          "workflow_id",
          "trigger",
          "payload",
          "estado",
          "error",
          "created_at",
          "completado_at"
        ],
        "title": "WorkflowRunRead"
      },
      "WorkflowRunRequest": {
        "properties": {
          "payload": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payload"
          }
        },
        "type": "object",
        "title": "WorkflowRunRequest",
        "description": "Payload opcional del trigger manual."
      },
      "WorkflowRunState": {
        "type": "string",
        "enum": [
          "running",
          "completed",
          "failed"
        ],
        "title": "WorkflowRunState"
      },
      "WorkflowTrigger": {
        "type": "string",
        "enum": [
          "manual",
          "schedule",
          "evento"
        ],
        "title": "WorkflowTrigger"
      },
      "WorkflowUpdate": {
        "properties": {
          "nombre": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nombre"
          },
          "descripcion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Descripcion"
          },
          "activo": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Activo"
          },
          "trigger_tipo": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkflowTrigger"
              },
              {
                "type": "null"
              }
            ]
          },
          "cron_expr": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cron Expr"
          },
          "evento": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evento"
          },
          "definicion": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Definicion"
          }
        },
        "type": "object",
        "title": "WorkflowUpdate"
      }
    }
  }
}