{
  "openapi": "3.0.1",
  "info": {
    "title": "API pública de KLYOO — Facturación electrónica",
    "description": "Emisión de facturas y notas contra la DIAN, consulta de catálogos y clientes, y el feed de eventos.\n\n**Autenticación**: OAuth2 `client_credentials` contra `POST /v1/oauth/token`. El token dura 15 minutos.\n\n**Errores**: todos comparten la forma `{ code, message, correlationId }`. Ramifique por `code`, que es estable; el `message` está en español y puede cambiar.\n\n⚠️ **Crear una factura en un ambiente de producción la transmite a la DIAN.** Para probar, use una credencial de pruebas (`klc_test_…`), que emite contra el ambiente de habilitación y no produce documentos con validez fiscal.",
    "contact": {
      "name": "KLYOO",
      "url": "https://klyoo.net"
    },
    "version": "v1"
  },
  "paths": {
    "/v1/cajas/ajustes": {
      "get": {
        "tags": [
          "CajasV"
        ],
        "summary": "#641 · Ajustes de la cuenta para sus cajas (`{ \"soporteAutomatico\": true }`). La caja lo consulta\r\ncada pocos minutos; sin fila = prendido. 503 si no se pudo leer (la caja usa su último valor).\r\nMismo scope que el resto de `/v1/cajas`; permiso de lectura, como `GET /v1/datafonos/cupo`.",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AjustesCajaDto"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/cajas/cierres": {
      "post": {
        "tags": [
          "CajasV"
        ],
        "summary": "Envía por correo el resumen del turno que se acaba de cerrar. 200 con `enviadoA` = a cuántos\r\ncorreos salió (0 si la cuenta no tiene correos de notificaciones: no es error). 400\r\n`CIERRE_INVALIDO` si falta cajero/estación/fechas o hay montos imposibles. 503 si no salió\r\nninguno (la caja puede reintentar); con al menos uno enviado responde 200 para no duplicar.",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CierreCajaApiDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CierreCajaApiDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CierreCajaApiDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CierreCajaRespuestaDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/cajas/eventos": {
      "post": {
        "tags": [
          "CajasV"
        ],
        "summary": "#689 · Anulaciones, pagos internos y pagos internos anulados de la caja (máximo 50 por llamada). KLYOO los registra (un\r\n`idEvento` repetido no se vuelve a avisar) y encola su aviso al grupo de Telegram de la cuenta según sus\r\ncasillas; responde sin esperar a Telegram (`avisados` = encolados para avisar). 200 siempre que el request\r\nsea válido, haya o no grupo. 400\r\n`EVENTO_INVALIDO` / `TIPO_EVENTO_INVALIDO`; 503 si no se pudo guardar (la caja reintenta).",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventosCajaApiDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/EventosCajaApiDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/EventosCajaApiDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventosCajaRespuestaDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/cajas/logs": {
      "post": {
        "tags": [
          "CajasV"
        ],
        "summary": "#765 · Líneas de log de la caja (1 a 500 por llamada; acepta `Content-Encoding: gzip`, tope 2 MB\r\ndescomprimido). Idempotente por equipo + serie + seq: la caja reintenta el lote entero si no recibió respuesta\r\ny lo ya guardado no se duplica. 200 `{ recibidas, nuevas, descartadas }`; 422 `LOTE_INVALIDO` si\r\nfalta equipo/serie o la cantidad de líneas está fuera de 1..500; 503 si no se pudo guardar (la caja reintenta).\r\nLa cuenta sale del token. Cubierto en el gateway por `/v1/cajas/{**catch-all}`.",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CajaLogsApiDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CajaLogsApiDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CajaLogsApiDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CajaLogsRespuestaDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/cajas/telegram": {
      "get": {
        "tags": [
          "CajasV"
        ],
        "summary": "#689 · Estado del grupo de Telegram de la cuenta: vinculado, título, fecha y las tres casillas.",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramCajaEstadoDto"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      },
      "delete": {
        "tags": [
          "CajasV"
        ],
        "summary": "#689 · Desvincula el grupo (las casillas vuelven a prendidas). Devuelve el estado (`vinculado=false`).",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramCajaEstadoDto"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/cajas/telegram/avisos": {
      "put": {
        "tags": [
          "CajasV"
        ],
        "summary": "#689 · Qué se avisa al grupo (`anulaciones`, `pagosInternos`, `cierres`). Devuelve el estado.",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AvisosTelegramCajaDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AvisosTelegramCajaDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AvisosTelegramCajaDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramCajaEstadoDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/cajas/telegram/codigo": {
      "post": {
        "tags": [
          "CajasV"
        ],
        "summary": "#689 · Código de un solo uso (vence a los 7 días) para escribir `/vincular CÓDIGO` en el grupo.",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramCajaCodigoDto"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/cajas/telegram/prueba": {
      "post": {
        "tags": [
          "CajasV"
        ],
        "summary": "#689 · Mensaje de prueba al grupo: `Enviado` | `NoVinculado` | `ChatInaccesible` | `Fallo`.",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramCajaPruebaDto"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/catalogos/resoluciones": {
      "get": {
        "tags": [
          "CatalogosV"
        ],
        "summary": "Las resoluciones de numeración que esta credencial puede usar.\r\n            \r\nUna credencial de pruebas ve solo las de pruebas, y una de producción solo las reales: son\r\ndos mundos que no se cruzan.",
        "parameters": [
          {
            "name": "tipoDocumento",
            "in": "query",
            "description": "Opcional. Código DIAN: `01` factura, `91` nota crédito, `92` nota débito.\r\nSin este parámetro vienen todas.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolucionApiDtoListaApiDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/catalogos/sucursales": {
      "get": {
        "tags": [
          "CatalogosV"
        ],
        "summary": "Las sucursales activas del cliente.",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SucursalApiDtoListaApiDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clientes": {
      "get": {
        "tags": [
          "ClientesV"
        ],
        "summary": "Busca un cliente por tipo y número de documento.\r\n            \r\nEs la única identidad que conoce quien integra: los identificadores internos de KLYOO no los\r\npuede saber. Sirve para no dar de alta un duplicado antes de facturar.",
        "parameters": [
          {
            "name": "tipoDocumento",
            "in": "query",
            "description": "Código DIAN (`13`, `31`, `22`, `41`…) o de KLYOO (`CC`, `NI`…).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "numeroDocumento",
            "in": "query",
            "description": "Solo el número. Para el NIT, sin el dígito de verificación.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClienteApiDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ClientesV"
        ],
        "summary": "Da de alta un cliente.\r\n            \r\nSi ya existe uno con ese documento responde <b>409</b> con el cliente existente en el\r\ncuerpo, en vez de duplicarlo o de pisar lo que hay guardado.",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClienteApiCrearDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ClienteApiCrearDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ClienteApiCrearDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClienteApiDto"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClienteApiDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clientes/dian": {
      "get": {
        "tags": [
          "ClientesV"
        ],
        "summary": "Consulta a la DIAN el nombre y los correos de un adquiriente (servicio GetAcquirer), para que\r\nel punto de venta los confirme antes de facturarle. No crea ni modifica nada en KLYOO.\r\n            \r\nEs lo mismo que hace la pantalla «tercero nuevo». Para facturarle, se mandan esos datos —con\r\nlos correos que el cajero haya agregado en `receptor.emailsAdicionales`— en\r\n`POST /v1/facturas`.",
        "parameters": [
          {
            "name": "tipoDocumento",
            "in": "query",
            "description": "Código DIAN (`13`, `31`, `22`, `41`…) o de KLYOO (`CC`, `NI`…).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "numeroDocumento",
            "in": "query",
            "description": "Solo el número. Para el NIT, sin el dígito de verificación.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClienteDianApiDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/consumo": {
      "get": {
        "tags": [
          "ConsumoV"
        ],
        "summary": "Consumo del mes periodo (YYYY-MM; sin él, el mes en curso).",
        "parameters": [
          {
            "name": "periodo",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsumoApiDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/datafonos/cobros": {
      "post": {
        "tags": [
          "DatafonosV"
        ],
        "summary": "#545 · La caja sube sus cobros con datáfono (hasta 200 por petición) para el informe \"Ventas por\r\ndatáfono\". Idempotente por `idLocal`: el mismo lote dos veces no duplica y una versión vieja\r\n(`actualizadoEn` menor) no pisa la guardada; las dos van en `aceptados`. Un cobro inválido\r\nvuelve en `rechazados` con `COBRO_INVALIDO` sin tumbar el resto (200). Lote mal formado = 422.\r\nCubierto en el gateway por la ruta `/v1/datafonos/{**catch-all}` de #540.",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubidaCobrosApiDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SubidaCobrosApiDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SubidaCobrosApiDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubidaCobrosResultadoDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/datafonos/cupo": {
      "get": {
        "tags": [
          "DatafonosV"
        ],
        "summary": "Cupo de datáfonos de la cuenta y cuántos están vinculados (de cualquier origen).",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CupoDatafonosDto"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/datafonos/estaciones/{estacion}": {
      "put": {
        "tags": [
          "DatafonosV"
        ],
        "summary": "Reemplaza el conjunto de terminales de la estación. Los que ya no vienen se desvinculan; los nuevos\r\nse vinculan en orden mientras haya cupo y el resto vuelve en `rechazados` con\r\n`DATAFONO_SIN_CUPO` (200: el reporte se procesó). Un terminal que estaba en otra estación de la\r\nmisma cuenta se mueve a esta sin consumir cupo. Repetir el mismo reporte no cambia nada.",
        "parameters": [
          {
            "name": "estacion",
            "in": "path",
            "description": "Nombre del equipo (PC) donde corre la caja.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReporteEstacionApiDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReporteEstacionApiDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReporteEstacionApiDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReporteEstacionResultadoDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/v1/eventos": {
      "get": {
        "tags": [
          "EventosV"
        ],
        "summary": "Los eventos posteriores a un cursor.\r\n            \r\nEl uso normal es: guardar el `siguienteCursor` de cada respuesta y mandarlo como\r\n`desde` en la siguiente llamada. Mientras `hayMas` venga en `true`, se puede\r\nvolver a llamar de inmediato para ponerse al día.",
        "parameters": [
          {
            "name": "desde",
            "in": "query",
            "description": "Cursor exclusivo: se devuelve lo que tiene id MAYOR que este. Sin él, desde el principio.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "tipo",
            "in": "query",
            "description": "Opcional: `factura.creada`, `factura.enviada_dian`, `factura.aceptada_dian`,\r\n`factura.rechazada_dian`, `nota_credito.aceptada_dian`,\r\n`nota_credito.rechazada_dian`, `nota_debito.aceptada_dian`,\r\n`nota_debito.rechazada_dian`. Un tipo que no existe se rechaza con 422 en vez de\r\ndevolver vacío.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limite",
            "in": "query",
            "description": "Cuántos como máximo. Por defecto 50, tope 200.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedEventosApiDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/facturas": {
      "post": {
        "tags": [
          "FacturasV"
        ],
        "summary": "Crea una factura y, salvo que se pida lo contrario, la transmite a la DIAN.\r\n            \r\nMandar `Idempotency-Key` es muy recomendable: con esa clave, reintentar después de un\r\ntimeout devuelve la misma factura en vez de crear otra.",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FacturaApiCrearDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/FacturaApiCrearDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/FacturaApiCrearDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacturaApiResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "FacturasV"
        ],
        "summary": "Lista facturas: paginado, con filtros por referencia externa, estado y rango de fechas.\r\n            \r\nES EL CAMINO DE RECONCILIACIÓN. Después de un corte de red, quien integra pregunta si la\r\nfactura del ticket 4471 llegó a crearse; a diferencia de la clave de idempotencia, esto no\r\nvence. Filtrando por `referenciaExterna` devuelve 0 o 1 documento — no por convención,\r\nsino porque esa columna tiene un índice único parcial en la base, verificado\r\n(`indisvalid`, no `pg_indexes`) sobre los tenants.\r\n            \r\n⚠️ CAMBIO DE CONTRATO. Antes este endpoint exigía `referenciaExterna` y devolvía el\r\ndocumento pelado. Ahora todos los parámetros son opcionales y siempre devuelve una página\r\n—`datos` más `total`—. Se hizo ahora, con la superficie recién abierta y sin\r\nnadie consumiéndola en producción: un endpoint que devuelve a veces un objeto y a veces una\r\nlista deja un tipo unión en el OpenAPI que después no se saca.\r\n            \r\nSin parámetros de fecha NO se aplica ninguna ventana. Ver `IFacturaApiPublicaService`\r\npara las tres garantías del contrato y el porqué de cada una.",
        "parameters": [
          {
            "name": "referenciaExterna",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "estado",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "desde",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hasta",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pagina",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "limite",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacturaApiResponseDtoPaginaApiDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/facturas/{id}": {
      "get": {
        "tags": [
          "FacturasV"
        ],
        "summary": "Estado y datos de una factura.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacturaApiResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/facturas/{id}/anular": {
      "post": {
        "tags": [
          "FacturasV"
        ],
        "summary": "Anula una factura completa emitiendo la nota crédito correspondiente, en un solo llamado.\r\n            \r\nLos ítems, los impuestos y los totales salen de la factura: no hay que reconstruirlos ni\r\nhay forma de que difieran. Devuelve la <b>nota</b> creada, con su número y su estado ante\r\nla DIAN.\r\n            \r\nPara anular parcialmente —una devolución de dos platos de una mesa de seis— este endpoint\r\nno sirve: usá `POST /v1/notas-credito`, donde los valores se declaran.\r\n            \r\n⚠️ Consume un consecutivo de la resolución de notas crédito y, salvo que se pida lo\r\ncontrario, transmite a la DIAN. Es irreversible.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotaApiAnulacionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/NotaApiAnulacionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/NotaApiAnulacionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaApiResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/facturas/{id}/emitir-definitiva": {
      "post": {
        "tags": [
          "FacturasV"
        ],
        "summary": "<b>[LEGADO]</b> — desde la ronda 7 de #502 la prefactura de reserva no se guarda (ver\r\n             `POST /v1/facturas/prefactura-reserva`); esto queda para los borradores de reserva creados\r\n             antes. #502 · Emite la factura DEFINITIVA de una prefactura (borrador de reserva) y la transmite.\r\n            \r\n             Copia tal cual los valores del borrador —receptor, ítems, impuestos, cargos, descuentos,\r\n             retenciones, anticipos, pagos y totales; no recalcula nada—, con fecha de hoy, numerada en la\r\n             resolución por defecto de la credencial o la principal (nunca la del borrador; en pruebas, la\r\n             del sandbox). `referenciaExterna` = la del borrador + `-D`; observaciones + «Reemplaza\r\n             la prefactura …». Si la DIAN la aprueba, el borrador pasa a ARCHIVADO; si la transmisión falla,\r\n             el borrador queda como está y la definitiva se reintenta con `/enviar`.\r\n            \r\n             Idempotente: con la misma `Idempotency-Key`, o simplemente repitiendo el llamado sobre el\r\n             mismo borrador, devuelve la definitiva ya creada (200) en vez de emitir otra.\r\n             Responde la definitiva (mismo DTO que `POST /v1/facturas`) con `prefacturaId`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacturaApiResponseDto"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacturaApiResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/facturas/{id}/enviar": {
      "post": {
        "tags": [
          "FacturasV"
        ],
        "summary": "Transmite a la DIAN una factura que quedó en borrador, o reintenta una que falló.\r\n            \r\nEs idempotente por naturaleza: reenviar una factura ya aceptada devuelve su estado, no la\r\nvuelve a transmitir.\r\n            \r\n`refechar=true` (#502, prefacturas): si la fecha del documento es anterior a hoy, la\r\ncambia a hoy —y el vencimiento, con el mismo plazo—, agrega `\"Venta del dd/MM/yyyy.\"` a\r\nlas observaciones (una sola vez, aunque se reintente) y transmite. No recalcula ningún valor.\r\nAplica a documentos no aceptados todavía (BORRADOR, o un envío anterior que falló); sobre una\r\nfactura ya aprobada se ignora y devuelve su estado; sobre una archivada/anulada ⇒ 409\r\n`REFECHAR_NO_PERMITIDO`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "refechar",
            "in": "query",
            "description": "Default `false` = comportamiento de siempre.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "ordenConsecutivo",
            "in": "query",
            "description": "#728 · `ignorar` (default) = comportamiento de siempre (las cajas). `verificar` = si la factura\r\n(PENDIENTE o BORRADOR) no es la siguiente de su resolución ⇒ 409 `CONSECUTIVO_FUERA_DE_ORDEN` con\r\n`data` (numeroActual, numeroDestino, ultimaAprobada, intercambiaCon) y sin tocar nada.\r\n`reemplazar` = le reemplaza el consecutivo y la transmite; si no se puede ⇒ 409\r\n`REEMPLAZO_CONSECUTIVO_FALLIDO` sin transmitir. Otro valor ⇒ 400 `ORDEN_CONSECUTIVO_INVALIDO`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacturaApiResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/facturas/{id}/representacion-grafica": {
      "get": {
        "tags": [
          "FacturasV"
        ],
        "summary": "La representación gráfica de la factura. Es lo que se le entrega al comprador.\r\n            \r\nA diferencia del XML, no exige que la DIAN la haya aceptado: sirve para mostrarle el\r\ndocumento al cliente antes de transmitirlo.\r\n            \r\nDOS FORMATOS, UN SOLO DOCUMENTO:\r\n  • sin `formato`, o `formato=estandar` ⇒ el PDF Carta de siempre.\r\n  • `formato=pos` ⇒ la tirilla de 80 mm (o de 58 mm con `ancho=58`) en bytes ESC/POS crudos, para mandar a una\r\n    térmica por TCP:9100 o por el spooler RAW de Windows. NO es un PDF: una térmica que\r\n    recibe un PDF por ese canal imprime metros de basura.\r\n  • `formato=pos-grafica` ⇒ #502 · ronda 11: la tirilla GRÁFICA, un HTML autocontenido (CSS\r\n    inline, QR y logo en data-URI) al ancho exacto del cabezal —384 px con `ancho=58`, 576 px\r\n    con `ancho=80` (default), 1 px = 1 punto— para rasterizar e imprimir como imagen. Es la que\r\n    imprime Aldelo.\r\n  • `formato=pos-html` ⇒ el MISMO documento que `pos-grafica` (la vista previa es lo que\r\n    se imprime). El ESC/POS de texto (`pos`) queda de respaldo.\r\n            \r\n⚠️ NO TOCAR EL CAMINO SIN PARÁMETRO. Ya hay un integrador contra este endpoint esperando\r\nun PDF; devolver otra cosa le rompe la descarga en silencio.\r\n            \r\nLa tirilla exige que el emisor tenga habilitada la impresión POS: si no, 409\r\n`IMPRESION_POS_NO_HABILITADA`. El PDF estándar NO se gatea nunca.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "formato",
            "in": "query",
            "description": "`estandar` (default), `pos-grafica`, `pos` o `pos-html`. Otro valor ⇒ 400 `FORMATO_NO_SOPORTADO`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "presentacion",
            "in": "query",
            "description": "#502 · Opcional. `emitida` ⇒ con `pos`/`pos-html`, la tirilla de un BORRADOR sale\r\nsin el rótulo de borrador (prefacturas). Sin CUFE ni QR, porque no los hay. No aplica al PDF\r\n(400 `PRESENTACION_NO_SOPORTADA`); otro valor ⇒ 400 `PRESENTACION_NO_SOPORTADA`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ancho",
            "in": "query",
            "description": "#502 · ronda 8 · Opcional, solo con `pos`/`pos-html` (también con cualquier\r\n`presentacion`). Ancho del papel en mm: `80` (default, 48 columnas) o `58` (42\r\ncolumnas, letra chica: ESC M 1). Otro valor, o mandarlo con el PDF estándar ⇒ 400 `ANCHO_NO_SOPORTADO`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/html": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/html": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/html": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/facturas/{id}/xml": {
      "get": {
        "tags": [
          "FacturasV"
        ],
        "summary": "El XML fiscal de la factura: el AttachedDocument firmado que la DIAN aceptó.\r\n            \r\nEs el documento que hay que archivar. Solo existe una vez aceptada — antes devuelve\r\n`409 FACTURA_SIN_XML_FISCAL`, y si acaba de aceptarse pero todavía se está guardando,\r\n`409 XML_NO_DISPONIBLE_AUN`, que sí conviene reintentar.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/facturas/prefactura-reserva": {
      "post": {
        "tags": [
          "FacturasV"
        ],
        "summary": "#502 · ronda 7 · PREFACTURA DE RESERVA (sin documento). Toma un número de la serie de reserva y\r\ndevuelve la tirilla «como emitida» (HTML + ESC/POS en base64, sin CUFE ni QR). NO crea factura en\r\nKLYOO, no transmite y no genera eventos. La factura real se emite después con un\r\n`POST /v1/facturas` normal.\r\n            \r\n`Idempotency-Key` es OBLIGATORIA (400 `IDEMPOTENCY_KEY_REQUERIDA`): un reintento con la\r\nmisma clave devuelve la MISMA respuesta y no gasta otro número. El body es el mismo de\r\n`POST /v1/facturas`; se ignoran `enviarADian` y `prefacturaReserva`.",
        "parameters": [
          {
            "name": "ancho",
            "in": "query",
            "description": "#502 · ronda 8 · Opcional. Ancho del papel en mm: `80` (default, 48 columnas) o `58`\r\n(42 columnas, letra chica de la térmica). Aplica a `tirillaHtml` y a `tirillaEscPosBase64`. Otro valor ⇒ 400\r\n`ANCHO_NO_SOPORTADO` sin tomar número. La misma clave con otro ancho ⇒ 409 `IDEMPOTENCY_KEY_REUSED`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FacturaApiCrearDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/FacturaApiCrearDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/FacturaApiCrearDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrefacturaReservaApiResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "FacturasV"
        ],
        "summary": "#783 · RECUPERA UNA PREFACTURA DE RESERVA YA TOMADA, por su `Idempotency-Key`. Para la caja\r\nque recibió el número de `POST /v1/facturas/prefactura-reserva` y se cayó antes de guardarlo:\r\nreintentar el POST con otro cuerpo da 409 `IDEMPOTENCY_KEY_REUSED`, y esto le devuelve lo\r\nque ya se le había respondido.\r\n            \r\nResponde EXACTAMENTE el mismo cuerpo (y el mismo 200) que devolvió el POST exitoso: número,\r\nresolución y las tirillas tal como salieron, con el ancho con que se pidieron. Solo lectura: no\r\ntoma número, no consume cupo, no reserva ni libera la clave. Solo ve las reservas de la MISMA\r\ncredencial que llama.\r\n            \r\n400 `IDEMPOTENCY_KEY_REQUERIDA` sin `clave` · 409 `SOLICITUD_EN_CURSO` si el POST\r\noriginal todavía no terminó · 409 `RESERVA_ABANDONADA` si el POST original murió sin terminar\r\n(pasados 10 minutos en curso): reintentar el POST con la misma clave y el mismo cuerpo la libera o\r\nla reanuda; si el número alcanzó a registrarse viene en `data.numero` · 404\r\n`RESERVA_NO_ENCONTRADA` si la clave no existe, es de otra credencial o el POST terminó en\r\nerror · 500 `RESPUESTA_GUARDADA_ILEGIBLE` si la reserva existe pero su respuesta guardada no se\r\npuede leer.\r\n            \r\nLa respuesta se conserva AL MENOS 30 días desde el POST; puede seguir sirviéndose algo más, hasta\r\nque la purga periódica la borre. Pasado ese plazo responde 404.",
        "parameters": [
          {
            "name": "clave",
            "in": "query",
            "description": "La `Idempotency-Key` con que se pidió la reserva (ej. `ALDELO-553568-D8741F46~reserva`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrefacturaReservaApiResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/facturas/prefacturas/control": {
      "get": {
        "tags": [
          "FacturasV"
        ],
        "summary": "Interruptor de prefacturas que el cliente maneja desde KLYOOAPP (Configuración > Facturación).\r\n`activas=false` ⇒ la caja no prefactura: toda venta sale con la resolución principal.\r\n`activas=true` ⇒ rigen las reglas configuradas en la caja. Nunca guardado = `true`.\r\n#788: responde lo que rige para la caja que pregunta (la credencial del token): su ajuste propio\r\no, si no tiene, el de todas las cajas. La caja lo consulta periódicamente; mismo scope y permiso\r\nque `prefactura-reserva`.\r\n\nPor estación (multicaja: todas las cajas del local facturan con la credencial de la\r\nprincipal): `?estaciones=CAJA1,CAJA2` registra las estaciones de Aldelo de la caja y agrega\r\n`estaciones: [{ estacion, activas }]` con lo que rige en cada una (su ajuste o, si no tiene,\r\nlo de la caja). Nombres normalizados (Trim + mayúsculas), hasta 64 caracteres, máximo 30. Sin el\r\nparámetro la respuesta es la de siempre.",
        "parameters": [
          {
            "name": "estaciones",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrefacturaControlDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notas-credito": {
      "post": {
        "tags": [
          "NotasCreditoV"
        ],
        "summary": "Crea una nota crédito. La factura corregida se puede indicar por su identificador o por la\r\nreferencia que le puso quien integra, que es lo natural para un punto de venta.",
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotaApiCrearDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/NotaApiCrearDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/NotaApiCrearDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaApiResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "NotasCreditoV"
        ],
        "summary": "Lista notas crédito: paginado, con filtros por referencia externa, estado y rango de fechas.\r\n            \r\n⚠️ Mismo cambio de contrato que el listado de facturas: antes exigía\r\n`referenciaExterna` y devolvía el documento pelado; ahora todos los parámetros son\r\nopcionales y siempre devuelve una página. Y sin parámetros de fecha no se aplica ninguna\r\nventana implícita.",
        "parameters": [
          {
            "name": "referenciaExterna",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "estado",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "desde",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hasta",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pagina",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "limite",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaApiResponseDtoPaginaApiDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notas-credito/{id}": {
      "get": {
        "tags": [
          "NotasCreditoV"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaApiResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notas-credito/{id}/enviar": {
      "post": {
        "tags": [
          "NotasCreditoV"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaApiResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notas-credito/{id}/representacion-grafica": {
      "get": {
        "tags": [
          "NotasCreditoV"
        ],
        "summary": "La representación gráfica en PDF. No exige aprobación: es el comprobante que se entrega.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notas-credito/{id}/xml": {
      "get": {
        "tags": [
          "NotasCreditoV"
        ],
        "summary": "El XML fiscal de la nota crédito aceptada por la DIAN. Existe solo en estado\r\n`APROBADO`; antes devuelve 409 explicando en qué estado está.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notas-debito": {
      "post": {
        "tags": [
          "NotasDebitoV"
        ],
        "parameters": [
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotaApiCrearDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/NotaApiCrearDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/NotaApiCrearDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaApiResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "NotasDebitoV"
        ],
        "summary": "Lista notas débito: paginado, con filtros por referencia externa, estado y rango de fechas.\r\n            \r\n⚠️ Mismo cambio de contrato y las mismas garantías que el listado de notas crédito.",
        "parameters": [
          {
            "name": "referenciaExterna",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "estado",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "desde",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hasta",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pagina",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "limite",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaApiResponseDtoPaginaApiDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notas-debito/{id}": {
      "get": {
        "tags": [
          "NotasDebitoV"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaApiResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notas-debito/{id}/enviar": {
      "post": {
        "tags": [
          "NotasDebitoV"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaApiResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notas-debito/{id}/representacion-grafica": {
      "get": {
        "tags": [
          "NotasDebitoV"
        ],
        "summary": "La representación gráfica en PDF. No exige aprobación: es el comprobante que se entrega.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notas-debito/{id}/xml": {
      "get": {
        "tags": [
          "NotasDebitoV"
        ],
        "summary": "El XML fiscal de la nota débito aceptada por la DIAN. Existe solo en estado\r\n`APROBADO`; antes devuelve 409 explicando en qué estado está.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "API-Version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AjustesCajaDto": {
        "type": "object",
        "properties": {
          "soporteAutomatico": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "AnulacionCobroApiDto": {
        "type": "object",
        "properties": {
          "estado": {
            "type": "string",
            "nullable": true
          },
          "idDeTransaccion": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "codigoDeRespuesta": {
            "type": "string",
            "nullable": true
          },
          "codigoDeAprobacion": {
            "type": "string",
            "nullable": true
          },
          "numeroDeRecibo": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "creadaEn": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AvisosTelegramCajaDto": {
        "type": "object",
        "properties": {
          "anulaciones": {
            "type": "boolean"
          },
          "pagosInternos": {
            "type": "boolean"
          },
          "cierres": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "CajaLogLineaApiDto": {
        "type": "object",
        "properties": {
          "seq": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "fecha": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "texto": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CajaLogsApiDto": {
        "type": "object",
        "properties": {
          "equipo": {
            "type": "string",
            "nullable": true
          },
          "serie": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "version": {
            "type": "string",
            "nullable": true
          },
          "reenviadoPor": {
            "type": "string",
            "nullable": true
          },
          "lineas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CajaLogLineaApiDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CajaLogsRespuestaDto": {
        "type": "object",
        "properties": {
          "recibidas": {
            "type": "integer",
            "format": "int32"
          },
          "nuevas": {
            "type": "integer",
            "format": "int32"
          },
          "descartadas": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "CierreCajaApiDto": {
        "type": "object",
        "properties": {
          "referencia": {
            "type": "string",
            "nullable": true
          },
          "restaurante": {
            "type": "string",
            "nullable": true
          },
          "estacion": {
            "type": "string",
            "nullable": true
          },
          "caja": {
            "type": "string",
            "nullable": true
          },
          "cajero": {
            "type": "string",
            "nullable": true
          },
          "autorizo": {
            "type": "string",
            "nullable": true
          },
          "apertura": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "cierre": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "fondoInicial": {
            "type": "number",
            "format": "double"
          },
          "declarado": {
            "type": "number",
            "format": "double"
          },
          "ventas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VentaMedioPagoCierreDto"
            },
            "nullable": true
          },
          "numeroVentas": {
            "type": "integer",
            "format": "int32"
          },
          "totalVentas": {
            "type": "number",
            "format": "double"
          },
          "propinas": {
            "type": "number",
            "format": "double"
          },
          "retiros": {
            "$ref": "#/components/schemas/RetirosCierreDto"
          },
          "efectivoAEntregar": {
            "type": "number",
            "format": "double"
          },
          "diferencia": {
            "type": "number",
            "format": "double"
          },
          "facturacion": {
            "$ref": "#/components/schemas/FacturacionCierreDto"
          },
          "equipo": {
            "type": "string",
            "nullable": true
          },
          "version": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CierreCajaRespuestaDto": {
        "type": "object",
        "properties": {
          "enviadoA": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ClienteApiCrearDto": {
        "required": [
          "nombre",
          "numeroDocumento",
          "tipoDocumento"
        ],
        "type": "object",
        "properties": {
          "tipoDocumento": {
            "maxLength": 10,
            "minLength": 1,
            "type": "string"
          },
          "numeroDocumento": {
            "maxLength": 20,
            "minLength": 1,
            "type": "string"
          },
          "nombre": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "primerNombre": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          },
          "segundoNombre": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          },
          "primerApellido": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          },
          "segundoApellido": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          },
          "email": {
            "maxLength": 150,
            "type": "string",
            "format": "email",
            "nullable": true
          },
          "sucursalId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "direccion": {
            "maxLength": 200,
            "type": "string",
            "nullable": true
          },
          "codigoMunicipio": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "codigoDepartamento": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "codigoPais": {
            "maxLength": 5,
            "type": "string",
            "nullable": true
          },
          "telefono": {
            "maxLength": 30,
            "type": "string",
            "nullable": true
          },
          "regimenTributario": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "responsabilidadFiscal": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ClienteApiDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "tipoDocumento": {
            "type": "string",
            "nullable": true
          },
          "tipoDocumentoNombre": {
            "type": "string",
            "nullable": true
          },
          "numeroDocumento": {
            "type": "string",
            "nullable": true
          },
          "digitoVerificacion": {
            "type": "string",
            "nullable": true
          },
          "tipoPersona": {
            "type": "string",
            "nullable": true
          },
          "razonSocial": {
            "type": "string",
            "nullable": true
          },
          "primerNombre": {
            "type": "string",
            "nullable": true
          },
          "segundoNombre": {
            "type": "string",
            "nullable": true
          },
          "primerApellido": {
            "type": "string",
            "nullable": true
          },
          "segundoApellido": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "telefono": {
            "type": "string",
            "nullable": true
          },
          "direccion": {
            "type": "string",
            "nullable": true
          },
          "codigoMunicipio": {
            "type": "string",
            "nullable": true
          },
          "nombreMunicipio": {
            "type": "string",
            "nullable": true
          },
          "codigoDepartamento": {
            "type": "string",
            "nullable": true
          },
          "nombreDepartamento": {
            "type": "string",
            "nullable": true
          },
          "activo": {
            "type": "boolean"
          },
          "fechaCreacion": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "ClienteDianApiDto": {
        "type": "object",
        "properties": {
          "tipoDocumento": {
            "type": "string",
            "nullable": true
          },
          "numeroDocumento": {
            "type": "string",
            "nullable": true
          },
          "nombre": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "emailsAdicionales": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "mensajeDian": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CobroDatafonoApiDto": {
        "type": "object",
        "properties": {
          "idLocal": {
            "type": "string",
            "nullable": true
          },
          "orderId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "mesa": {
            "type": "string",
            "nullable": true
          },
          "referenciaExterna": {
            "type": "string",
            "nullable": true
          },
          "codigoTerminal": {
            "type": "string",
            "nullable": true
          },
          "nombreDatafono": {
            "type": "string",
            "nullable": true
          },
          "numeroCaja": {
            "type": "string",
            "nullable": true
          },
          "idCajero": {
            "type": "string",
            "nullable": true
          },
          "origen": {
            "type": "string",
            "nullable": true
          },
          "idDeTransaccion": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "estado": {
            "type": "string",
            "nullable": true
          },
          "monto": {
            "type": "number",
            "format": "double"
          },
          "valorVenta": {
            "type": "number",
            "format": "double"
          },
          "valorIva": {
            "type": "number",
            "format": "double"
          },
          "valorIac": {
            "type": "number",
            "format": "double"
          },
          "valorPropina": {
            "type": "number",
            "format": "double"
          },
          "esParcial": {
            "type": "boolean"
          },
          "montoEnDuda": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "respuesta": {
            "$ref": "#/components/schemas/RespuestaDatafonoApiDto"
          },
          "resolucionManual": {
            "$ref": "#/components/schemas/ResolucionManualApiDto"
          },
          "anulacion": {
            "$ref": "#/components/schemas/AnulacionCobroApiDto"
          },
          "reintentoDe": {
            "type": "string",
            "nullable": true
          },
          "reintentadoPor": {
            "type": "string",
            "nullable": true
          },
          "creadoEn": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "actualizadoEn": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CobroRechazadoDto": {
        "type": "object",
        "properties": {
          "idLocal": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "mensaje": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsumoApiDto": {
        "type": "object",
        "properties": {
          "periodo": {
            "$ref": "#/components/schemas/PeriodoConsumoApiDto"
          },
          "ambiente": {
            "type": "string",
            "nullable": true
          },
          "plan": {
            "$ref": "#/components/schemas/PlanConsumoApiDto"
          },
          "documentos": {
            "$ref": "#/components/schemas/DocumentosConsumoApiDto"
          },
          "incluidosPeriodo": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "incluidosRestantes": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "excedente": {
            "$ref": "#/components/schemas/ExcedenteConsumoApiDto"
          }
        },
        "additionalProperties": false
      },
      "CupoDatafonosDto": {
        "type": "object",
        "properties": {
          "cupo": {
            "type": "integer",
            "format": "int32"
          },
          "usados": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "DocumentosConsumoApiDto": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "aprobados": {
            "type": "integer",
            "format": "int32"
          },
          "rechazados": {
            "type": "integer",
            "format": "int32"
          },
          "porTipo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TipoConsumoApiDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ErrorDianApiDto": {
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string",
            "nullable": true
          },
          "descripcion": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EventoApiDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "tipo": {
            "type": "string",
            "nullable": true
          },
          "recursoTipo": {
            "type": "string",
            "nullable": true
          },
          "recursoId": {
            "type": "integer",
            "format": "int32"
          },
          "datos": {
            "$ref": "#/components/schemas/JsonNode"
          },
          "fecha": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "EventoCajaApiDto": {
        "type": "object",
        "properties": {
          "idEvento": {
            "type": "string",
            "nullable": true
          },
          "tipo": {
            "type": "string",
            "nullable": true
          },
          "fechaHora": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "empleado": {
            "type": "string",
            "nullable": true
          },
          "orden": {
            "type": "string",
            "nullable": true
          },
          "mesa": {
            "type": "string",
            "nullable": true
          },
          "item": {
            "type": "string",
            "nullable": true
          },
          "cantidad": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "valor": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "motivo": {
            "type": "string",
            "nullable": true
          },
          "ordenCompleta": {
            "type": "boolean",
            "nullable": true
          },
          "ordenFacturada": {
            "type": "boolean",
            "nullable": true
          },
          "beneficiario": {
            "type": "string",
            "nullable": true
          },
          "fechaPago": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EventosCajaApiDto": {
        "type": "object",
        "properties": {
          "equipo": {
            "type": "string",
            "nullable": true
          },
          "eventos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventoCajaApiDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EventosCajaRespuestaDto": {
        "type": "object",
        "properties": {
          "recibidos": {
            "type": "integer",
            "format": "int32"
          },
          "duplicados": {
            "type": "integer",
            "format": "int32"
          },
          "avisados": {
            "type": "integer",
            "format": "int32"
          },
          "telegramVinculado": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ExcedenteConsumoApiDto": {
        "type": "object",
        "properties": {
          "cantidad": {
            "type": "integer",
            "format": "int32"
          },
          "valorEstimado": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "FacturaApiAnticipoDto": {
        "type": "object",
        "properties": {
          "monto": {
            "type": "number",
            "format": "double"
          },
          "fecha": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "medioPago": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FacturaApiCargoDto": {
        "required": [
          "concepto"
        ],
        "type": "object",
        "properties": {
          "concepto": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "base": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "porcentaje": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "monto": {
            "type": "number",
            "format": "double"
          },
          "tipoCargoCodigo": {
            "maxLength": 5,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FacturaApiCrearDto": {
        "required": [
          "items",
          "receptor",
          "totales"
        ],
        "type": "object",
        "properties": {
          "referenciaExterna": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          },
          "resolucionId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "sucursalId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "fechaDocumento": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "fechaVencimiento": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "receptor": {
            "$ref": "#/components/schemas/ReceptorApiCrearDto"
          },
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiItemDto"
            }
          },
          "totales": {
            "$ref": "#/components/schemas/FacturaApiTotalesDto"
          },
          "pagos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiPagoDto"
            },
            "nullable": true
          },
          "cargos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiCargoDto"
            },
            "nullable": true
          },
          "descuentos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiDescuentoDto"
            },
            "nullable": true
          },
          "retenciones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiRetencionDto"
            },
            "nullable": true
          },
          "anticipos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiAnticipoDto"
            },
            "nullable": true
          },
          "ordenCompra": {
            "maxLength": 50,
            "type": "string",
            "nullable": true
          },
          "ordenes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiOrdenDto"
            },
            "nullable": true
          },
          "observaciones": {
            "type": "string",
            "nullable": true
          },
          "enviarADian": {
            "type": "boolean"
          },
          "dejarPendiente": {
            "type": "boolean"
          },
          "prefacturaReserva": {
            "type": "boolean"
          },
          "prefacturaOrigen": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FacturaApiDescuentoDto": {
        "required": [
          "concepto"
        ],
        "type": "object",
        "properties": {
          "concepto": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "base": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "porcentaje": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "monto": {
            "type": "number",
            "format": "double"
          },
          "tipoDescuentoCodigo": {
            "maxLength": 5,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FacturaApiItemDto": {
        "required": [
          "descripcion"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "maxLength": 50,
            "type": "string",
            "nullable": true
          },
          "descripcion": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "unidadMedida": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "cantidad": {
            "minimum": 0.0001,
            "type": "number",
            "format": "double"
          },
          "precioUnitario": {
            "minimum": 0,
            "type": "number",
            "format": "double"
          },
          "montoDescuento": {
            "type": "number",
            "format": "double"
          },
          "porcentajeDescuento": {
            "type": "number",
            "format": "double"
          },
          "motivoDescuento": {
            "maxLength": 200,
            "type": "string",
            "nullable": true
          },
          "retencionCodigo": {
            "maxLength": 5,
            "type": "string",
            "nullable": true
          },
          "retencionTarifa": {
            "type": "number",
            "format": "double"
          },
          "retencionMonto": {
            "type": "number",
            "format": "double"
          },
          "cargoMonto": {
            "type": "number",
            "format": "double"
          },
          "cargoPorcentaje": {
            "type": "number",
            "format": "double"
          },
          "cargoMotivo": {
            "maxLength": 200,
            "type": "string",
            "nullable": true
          },
          "impuestoCodigo": {
            "maxLength": 5,
            "type": "string",
            "nullable": true
          },
          "impuestoTarifa": {
            "type": "number",
            "format": "double"
          },
          "baseImponible": {
            "type": "number",
            "format": "double"
          },
          "impuestoMonto": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "FacturaApiOrdenDto": {
        "type": "object",
        "properties": {
          "secuencia": {
            "type": "integer",
            "format": "int32"
          },
          "tipoCodigo": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "tipoDescripcion": {
            "maxLength": 60,
            "type": "string",
            "nullable": true
          },
          "numero": {
            "maxLength": 50,
            "type": "string",
            "nullable": true
          },
          "fecha": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "codigoAsesor": {
            "maxLength": 30,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FacturaApiPagoDto": {
        "type": "object",
        "properties": {
          "medioPago": {
            "maxLength": 5,
            "type": "string",
            "nullable": true
          },
          "formaPago": {
            "maxLength": 5,
            "type": "string",
            "nullable": true
          },
          "monto": {
            "type": "number",
            "format": "double"
          },
          "fechaPago": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "referencia": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FacturaApiResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "numero": {
            "type": "string",
            "nullable": true
          },
          "prefijo": {
            "type": "string",
            "nullable": true
          },
          "consecutivo": {
            "type": "integer",
            "format": "int64"
          },
          "referenciaExterna": {
            "type": "string",
            "nullable": true
          },
          "prefacturaId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "prefacturaOrigen": {
            "type": "string",
            "nullable": true
          },
          "prefacturaVinculada": {
            "type": "boolean",
            "nullable": true
          },
          "reemplazoConsecutivo": {
            "$ref": "#/components/schemas/ReemplazoConsecutivoApiDto"
          },
          "estado": {
            "type": "string",
            "nullable": true
          },
          "cufe": {
            "type": "string",
            "nullable": true
          },
          "ambiente": {
            "type": "string",
            "nullable": true
          },
          "fechaDocumento": {
            "type": "string",
            "format": "date"
          },
          "fechaCreacion": {
            "type": "string",
            "format": "date-time"
          },
          "total": {
            "type": "number",
            "format": "double"
          },
          "receptor": {
            "$ref": "#/components/schemas/ReceptorApiResponseDto"
          },
          "ordenes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiOrdenDto"
            },
            "nullable": true
          },
          "errores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorDianApiDto"
            },
            "nullable": true
          },
          "mensajeError": {
            "type": "string",
            "nullable": true
          },
          "codigoError": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FacturaApiResponseDtoPaginaApiDto": {
        "type": "object",
        "properties": {
          "datos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiResponseDto"
            },
            "nullable": true
          },
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "pagina": {
            "type": "integer",
            "format": "int32"
          },
          "limite": {
            "type": "integer",
            "format": "int32"
          },
          "paginas": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "FacturaApiRetencionDto": {
        "type": "object",
        "properties": {
          "tipo": {
            "type": "string",
            "nullable": true
          },
          "base": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "porcentaje": {
            "type": "number",
            "format": "double"
          },
          "monto": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "FacturaApiTotalesDto": {
        "type": "object",
        "properties": {
          "subTotal": {
            "type": "number",
            "format": "double"
          },
          "descuentos": {
            "type": "number",
            "format": "double"
          },
          "cargos": {
            "type": "number",
            "format": "double"
          },
          "baseImponible": {
            "type": "number",
            "format": "double"
          },
          "impuestos": {
            "type": "number",
            "format": "double"
          },
          "retenciones": {
            "type": "number",
            "format": "double"
          },
          "anticipos": {
            "type": "number",
            "format": "double"
          },
          "total": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "FacturaIntercambiadaApiDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "numero": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FacturacionCierreDto": {
        "type": "object",
        "properties": {
          "emitidas": {
            "type": "integer",
            "format": "int32"
          },
          "montoFacturado": {
            "type": "number",
            "format": "double"
          },
          "enRevision": {
            "type": "integer",
            "format": "int32"
          },
          "sinFactura": {
            "type": "integer",
            "format": "int32"
          },
          "cobradasDeMenos": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "faltanteCobrado": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "cobradasDeMas": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "sobranteCobrado": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FeedEventosApiDto": {
        "type": "object",
        "properties": {
          "datos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventoApiDto"
            },
            "nullable": true
          },
          "siguienteCursor": {
            "type": "integer",
            "format": "int32"
          },
          "hayMas": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "JsonNode": {
        "type": "object",
        "properties": {
          "options": {
            "$ref": "#/components/schemas/JsonNodeOptions"
          },
          "parent": {
            "$ref": "#/components/schemas/JsonNode"
          },
          "root": {
            "$ref": "#/components/schemas/JsonNode"
          }
        },
        "additionalProperties": false
      },
      "JsonNodeOptions": {
        "type": "object",
        "properties": {
          "propertyNameCaseInsensitive": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "NotaApiAnulacionDto": {
        "type": "object",
        "properties": {
          "razon": {
            "maxLength": 500,
            "type": "string",
            "nullable": true
          },
          "referenciaExterna": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          },
          "observaciones": {
            "type": "string",
            "nullable": true
          },
          "enviarADian": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "NotaApiCrearDto": {
        "required": [
          "items",
          "razon",
          "totales"
        ],
        "type": "object",
        "properties": {
          "referenciaExterna": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          },
          "facturaId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "facturaReferenciaExterna": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          },
          "conceptoCorreccion": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "razon": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "resolucionId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "sucursalId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "fechaDocumento": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "receptor": {
            "$ref": "#/components/schemas/ReceptorApiCrearDto"
          },
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiItemDto"
            }
          },
          "totales": {
            "$ref": "#/components/schemas/FacturaApiTotalesDto"
          },
          "cargos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiCargoDto"
            },
            "nullable": true
          },
          "descuentos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiDescuentoDto"
            },
            "nullable": true
          },
          "retenciones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiRetencionDto"
            },
            "nullable": true
          },
          "anticipos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiAnticipoDto"
            },
            "nullable": true
          },
          "ordenes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiOrdenDto"
            },
            "nullable": true
          },
          "observaciones": {
            "type": "string",
            "nullable": true
          },
          "enviarADian": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "NotaApiResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "tipo": {
            "type": "string",
            "nullable": true
          },
          "numero": {
            "type": "string",
            "nullable": true
          },
          "prefijo": {
            "type": "string",
            "nullable": true
          },
          "consecutivo": {
            "type": "integer",
            "format": "int64"
          },
          "referenciaExterna": {
            "type": "string",
            "nullable": true
          },
          "estado": {
            "type": "string",
            "nullable": true
          },
          "cune": {
            "type": "string",
            "nullable": true
          },
          "ambiente": {
            "type": "string",
            "nullable": true
          },
          "fechaDocumento": {
            "type": "string",
            "format": "date"
          },
          "fechaCreacion": {
            "type": "string",
            "format": "date-time"
          },
          "total": {
            "type": "number",
            "format": "double"
          },
          "facturaId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "facturaNumero": {
            "type": "string",
            "nullable": true
          },
          "ordenes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacturaApiOrdenDto"
            },
            "nullable": true
          },
          "errores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorDianApiDto"
            },
            "nullable": true
          },
          "mensajeError": {
            "type": "string",
            "nullable": true
          },
          "codigoError": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "NotaApiResponseDtoPaginaApiDto": {
        "type": "object",
        "properties": {
          "datos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotaApiResponseDto"
            },
            "nullable": true
          },
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "pagina": {
            "type": "integer",
            "format": "int32"
          },
          "limite": {
            "type": "integer",
            "format": "int32"
          },
          "paginas": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "PeriodoConsumoApiDto": {
        "type": "object",
        "properties": {
          "desde": {
            "type": "string",
            "format": "date"
          },
          "hasta": {
            "type": "string",
            "format": "date"
          }
        },
        "additionalProperties": false
      },
      "PlanConsumoApiDto": {
        "type": "object",
        "properties": {
          "nombre": {
            "type": "string",
            "nullable": true
          },
          "mensualidad": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "documentosIncluidos": {
            "type": "integer",
            "format": "int32"
          },
          "precioExcedente": {
            "type": "number",
            "format": "double"
          },
          "cobroAnticipado": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "PrefacturaControlCajaDto": {
        "type": "object",
        "properties": {
          "apiClientId": {
            "type": "integer",
            "format": "int32"
          },
          "nombre": {
            "type": "string",
            "nullable": true
          },
          "alias": {
            "type": "string",
            "nullable": true
          },
          "ambiente": {
            "type": "string",
            "nullable": true
          },
          "activas": {
            "type": "boolean"
          },
          "propia": {
            "type": "boolean"
          },
          "fechaModificacion": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "estaciones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrefacturaControlEstacionDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PrefacturaControlDto": {
        "type": "object",
        "properties": {
          "activas": {
            "type": "boolean"
          },
          "fechaModificacion": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "aplica": {
            "type": "boolean"
          },
          "cajas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrefacturaControlCajaDto"
            },
            "nullable": true
          },
          "estaciones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrefacturaControlEstacionPublicaDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PrefacturaControlEstacionDto": {
        "type": "object",
        "properties": {
          "estacion": {
            "type": "string",
            "nullable": true
          },
          "alias": {
            "type": "string",
            "nullable": true
          },
          "activas": {
            "type": "boolean"
          },
          "propia": {
            "type": "boolean"
          },
          "ultimaVezVista": {
            "type": "string",
            "format": "date-time"
          },
          "fechaModificacion": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PrefacturaControlEstacionPublicaDto": {
        "type": "object",
        "properties": {
          "estacion": {
            "type": "string",
            "nullable": true
          },
          "activas": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "PrefacturaReservaApiResponseDto": {
        "type": "object",
        "properties": {
          "numero": {
            "type": "string",
            "nullable": true
          },
          "prefijo": {
            "type": "string",
            "nullable": true
          },
          "consecutivo": {
            "type": "integer",
            "format": "int64"
          },
          "resolucionId": {
            "type": "integer",
            "format": "int32"
          },
          "resolucion": {
            "$ref": "#/components/schemas/ResolucionResumenApiDto"
          },
          "fecha": {
            "type": "string",
            "format": "date"
          },
          "tirillaHtml": {
            "type": "string",
            "nullable": true
          },
          "tirillaEscPosBase64": {
            "type": "string",
            "nullable": true
          },
          "tirillaGraficaHtml": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "ReceptorApiCrearDto": {
        "required": [
          "numeroDocumento"
        ],
        "type": "object",
        "properties": {
          "tipoDocumento": {
            "type": "string",
            "nullable": true
          },
          "numeroDocumento": {
            "maxLength": 20,
            "minLength": 1,
            "type": "string"
          },
          "nombre": {
            "maxLength": 200,
            "type": "string",
            "nullable": true
          },
          "email": {
            "maxLength": 150,
            "type": "string",
            "nullable": true
          },
          "emailsAdicionales": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "primerNombre": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          },
          "segundoNombre": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          },
          "primerApellido": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          },
          "segundoApellido": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          },
          "direccion": {
            "maxLength": 200,
            "type": "string",
            "nullable": true
          },
          "codigoMunicipio": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "codigoDepartamento": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "codigoPais": {
            "maxLength": 5,
            "type": "string",
            "nullable": true
          },
          "telefono": {
            "maxLength": 30,
            "type": "string",
            "nullable": true
          },
          "regimenTributario": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "responsabilidadFiscal": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ReceptorApiResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "tipoDocumento": {
            "type": "string",
            "nullable": true
          },
          "numeroDocumento": {
            "type": "string",
            "nullable": true
          },
          "nombre": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "creado": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ReemplazoConsecutivoApiDto": {
        "type": "object",
        "properties": {
          "numeroAnterior": {
            "type": "string",
            "nullable": true
          },
          "numeroNuevo": {
            "type": "string",
            "nullable": true
          },
          "intercambiadaCon": {
            "$ref": "#/components/schemas/FacturaIntercambiadaApiDto"
          }
        },
        "additionalProperties": false
      },
      "ReporteEstacionApiDto": {
        "type": "object",
        "properties": {
          "terminales": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TerminalReporteApiDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ReporteEstacionResultadoDto": {
        "type": "object",
        "properties": {
          "estacion": {
            "type": "string",
            "nullable": true
          },
          "aceptados": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "rechazados": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TerminalRechazadaDto"
            },
            "nullable": true
          },
          "cupo": {
            "type": "integer",
            "format": "int32"
          },
          "usados": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ResolucionApiDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "numeroResolucion": {
            "type": "string",
            "nullable": true
          },
          "prefijo": {
            "type": "string",
            "nullable": true
          },
          "rangoDesde": {
            "type": "integer",
            "format": "int64"
          },
          "rangoHasta": {
            "type": "integer",
            "format": "int64"
          },
          "consecutivoActual": {
            "type": "integer",
            "format": "int64"
          },
          "disponiblesRestantes": {
            "type": "integer",
            "format": "int64"
          },
          "fechaInicioVigencia": {
            "type": "string",
            "format": "date"
          },
          "fechaFinVigencia": {
            "type": "string",
            "format": "date"
          },
          "tipoDocumentoCodigo": {
            "type": "string",
            "nullable": true
          },
          "esPrincipal": {
            "type": "boolean"
          },
          "esPruebas": {
            "type": "boolean"
          },
          "esReserva": {
            "type": "boolean"
          },
          "sucursalId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "vigente": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ResolucionApiDtoListaApiDto": {
        "type": "object",
        "properties": {
          "datos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResolucionApiDto"
            },
            "nullable": true
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ResolucionManualApiDto": {
        "type": "object",
        "properties": {
          "resultado": {
            "type": "string",
            "nullable": true
          },
          "nota": {
            "type": "string",
            "nullable": true
          },
          "en": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ResolucionResumenApiDto": {
        "type": "object",
        "properties": {
          "numeroResolucion": {
            "type": "string",
            "nullable": true
          },
          "prefijo": {
            "type": "string",
            "nullable": true
          },
          "rangoDesde": {
            "type": "integer",
            "format": "int64"
          },
          "rangoHasta": {
            "type": "integer",
            "format": "int64"
          },
          "fechaInicioVigencia": {
            "type": "string",
            "format": "date"
          },
          "fechaFinVigencia": {
            "type": "string",
            "format": "date"
          }
        },
        "additionalProperties": false
      },
      "RespuestaDatafonoApiDto": {
        "type": "object",
        "properties": {
          "codigoDeRespuesta": {
            "type": "string",
            "nullable": true
          },
          "mensajeDeRespuesta": {
            "type": "string",
            "nullable": true
          },
          "codigoDeAprobacion": {
            "type": "string",
            "nullable": true
          },
          "rrn": {
            "type": "string",
            "nullable": true
          },
          "numeroDeRecibo": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "franquicia": {
            "type": "string",
            "nullable": true
          },
          "tipoDeCuenta": {
            "type": "string",
            "nullable": true
          },
          "ultimosDigitosTarjeta": {
            "type": "string",
            "nullable": true
          },
          "numeroDeCuotas": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "fechaTransaccion": {
            "type": "string",
            "nullable": true
          },
          "horaTransaccion": {
            "type": "string",
            "nullable": true
          },
          "valorTotal": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "esMedioSinAnulacion": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "RetirosCierreDto": {
        "type": "object",
        "properties": {
          "cantidad": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "SubidaCobrosApiDto": {
        "type": "object",
        "properties": {
          "estacion": {
            "type": "string",
            "nullable": true
          },
          "cobros": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CobroDatafonoApiDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SubidaCobrosResultadoDto": {
        "type": "object",
        "properties": {
          "recibidos": {
            "type": "integer",
            "format": "int32"
          },
          "aceptados": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "rechazados": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CobroRechazadoDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SucursalApiDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "codigo": {
            "type": "string",
            "nullable": true
          },
          "nombre": {
            "type": "string",
            "nullable": true
          },
          "esPrincipal": {
            "type": "boolean"
          },
          "direccion": {
            "type": "string",
            "nullable": true
          },
          "codCiudad": {
            "type": "string",
            "nullable": true
          },
          "nombreCiudad": {
            "type": "string",
            "nullable": true
          },
          "codDepartamento": {
            "type": "string",
            "nullable": true
          },
          "nombreDepartamento": {
            "type": "string",
            "nullable": true
          },
          "telefono": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SucursalApiDtoListaApiDto": {
        "type": "object",
        "properties": {
          "datos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SucursalApiDto"
            },
            "nullable": true
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "TelegramCajaCodigoDto": {
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string",
            "nullable": true
          },
          "comando": {
            "type": "string",
            "nullable": true
          },
          "bot": {
            "type": "string",
            "nullable": true
          },
          "venceEn": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "TelegramCajaEstadoDto": {
        "type": "object",
        "properties": {
          "vinculado": {
            "type": "boolean"
          },
          "titulo": {
            "type": "string",
            "nullable": true
          },
          "fechaVinculacion": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "avisos": {
            "$ref": "#/components/schemas/AvisosTelegramCajaDto"
          }
        },
        "additionalProperties": false
      },
      "TelegramCajaPruebaDto": {
        "type": "object",
        "properties": {
          "estado": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TerminalRechazadaDto": {
        "type": "object",
        "properties": {
          "codigoTerminal": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "mensaje": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TerminalReporteApiDto": {
        "type": "object",
        "properties": {
          "codigoTerminal": {
            "type": "string",
            "nullable": true
          },
          "nombre": {
            "type": "string",
            "nullable": true
          },
          "numeroCaja": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TipoConsumoApiDto": {
        "type": "object",
        "properties": {
          "tipoDocumento": {
            "type": "string",
            "nullable": true
          },
          "aprobados": {
            "type": "integer",
            "format": "int32"
          },
          "rechazados": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "VentaMedioPagoCierreDto": {
        "type": "object",
        "properties": {
          "medio": {
            "type": "string",
            "nullable": true
          },
          "monto": {
            "type": "number",
            "format": "double"
          },
          "cantidad": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "JWT Authorization header using the Bearer scheme (Example: 'Bearer {token}')",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "X-Tenant-Id": {
        "type": "apiKey",
        "description": "Tenant ID header for multi-tenancy",
        "name": "X-Tenant-Id",
        "in": "header"
      },
      "API-Version": {
        "type": "apiKey",
        "description": "API Version header (e.g., 1.0, 2.0)",
        "name": "API-Version",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ]
}