{
  "openapi": "3.0.0",
  "info": {
    "title": "API de Berlinesa",
    "description": "Emisión y constatación de comprobantes electrónicos de ARCA/AFIP: facturas, notas de débito y notas de crédito, en sus variantes local (letra A/B/C/M), de exportación (E) y de turismo (T) — para N usuarios, en modo contador (un certificado delegado por N CUITs) o autoservicio (certificado propio por usuario).",
    "version": "0.1.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "http://localhost:3010",
      "description": "Desarrollo local"
    }
  ],
  "tags": [
    {
      "name": "invoices",
      "description": "Emisión, consulta, reintento y constatación de comprobantes: facturas, notas de débito y notas de crédito, en sus variantes local, de exportación y de turismo — el corazón de la API."
    },
    {
      "name": "voucher-verification",
      "description": "Constatación de cualquier comprobante autorizado (con CAE/CAI/CAEA), incluido uno emitido fuera de este sistema — a diferencia de `invoices`, no depende de que el comprobante exista en esta base."
    },
    {
      "name": "represented-cuits",
      "description": "CUITs en cuyo nombre se puede facturar bajo una credential — el propio (autoservicio) o delegados por un tercero (modo contador)."
    },
    {
      "name": "credentials",
      "description": "Alta y baja del certificado ARCA (cert + clave privada, cifrados) usado para autenticarse ante ARCA. El servidor siempre genera la clave privada — nunca se acepta una subida directa."
    },
    {
      "name": "padron",
      "description": "Consulta pública y de solo lectura del padrón de ARCA (razón social, domicilio, condición frente al IVA) para previsualizar un CUIT antes de guardarlo en algún lado."
    },
    {
      "name": "catalogs",
      "description": "Catálogos de referencia (tipos de comprobante, alícuotas de IVA, tipos de documento, puntos de venta, monedas, etc.) para completar los campos codificados de POST /invoices y otros endpoints."
    },
    {
      "name": "users",
      "description": "Perfil del usuario autenticado — solo el propio, sin CRUD de terceros."
    },
    {
      "name": "api-clients",
      "description": "Credenciales OAuth 2.0 (client_credentials) para acceso programático — integraciones server-to-server y agentes. Siempre se gestionan con un token de sesión de usuario, nunca con otro API Client."
    },
    {
      "name": "health",
      "description": "Healthcheck sin autenticación."
    },
    {
      "name": "errors",
      "description": "Catálogo completo de errores que puede devolver esta API — pensado para generar documentación aparte o un diccionario de errores del lado del cliente. Sin autenticación, es metadata estática del contrato."
    }
  ],
  "paths": {
    "/errors": {
      "get": {
        "description": "Todo `ApiError` declarado en el servicio (ver common/errors/api-error.ts), con su `code` compuesto ya resuelto contra el API_NUMBER real de este deployment. Orden estable por `id` ascendente.",
        "operationId": "ErrorsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiErrorCatalogEntryDto"
                  }
                },
                "example": [
                  {
                    "name": "SERVICE_UNAVAILABLE",
                    "id": 1,
                    "status": 503,
                    "code": 50301001,
                    "message": "%s",
                    "example_params": [
                      "El servicio no está disponible en este momento"
                    ],
                    "example_detail": "El servicio no está disponible en este momento"
                  },
                  {
                    "name": "RESOURCE_NOT_FOUND",
                    "id": 2,
                    "status": 404,
                    "code": 40401002,
                    "message": "%s no encontrado",
                    "example_params": [
                      "recurso"
                    ],
                    "example_detail": "recurso no encontrado"
                  },
                  {
                    "name": "CATALOG_NOT_FOUND",
                    "id": 3,
                    "status": 400,
                    "code": 40001003,
                    "message": "Catálogo no soportado: %s",
                    "example_params": [
                      "tipos-comprobante"
                    ],
                    "example_detail": "Catálogo no soportado: tipos-comprobante"
                  },
                  {
                    "name": "STATIC_CATALOG_NOT_FOUND",
                    "id": 4,
                    "status": 400,
                    "code": 40001004,
                    "message": "Catálogo estático no soportado: %s",
                    "example_params": [
                      "provincias"
                    ],
                    "example_detail": "Catálogo estático no soportado: provincias"
                  },
                  {
                    "name": "CANNOT_DELETE_SELF_REPRESENTED_CUIT",
                    "id": 5,
                    "status": 400,
                    "code": 40001005,
                    "message": "No se puede eliminar el RepresentedCuit propio (isSelf) de una credential",
                    "example_params": [],
                    "example_detail": "No se puede eliminar el RepresentedCuit propio (isSelf) de una credential"
                  },
                  {
                    "name": "REPRESENTED_CUIT_HAS_INVOICES",
                    "id": 6,
                    "status": 409,
                    "code": 40901006,
                    "message": "No se puede eliminar el RepresentedCuit: tiene comprobantes asociados",
                    "example_params": [],
                    "example_detail": "No se puede eliminar el RepresentedCuit: tiene comprobantes asociados"
                  },
                  {
                    "name": "REPRESENTED_CUIT_NOT_FOUND",
                    "id": 7,
                    "status": 404,
                    "code": 40401007,
                    "message": "RepresentedCuit no encontrado",
                    "example_params": [],
                    "example_detail": "RepresentedCuit no encontrado"
                  },
                  {
                    "name": "CREDENTIAL_REVOKED",
                    "id": 8,
                    "status": 403,
                    "code": 40301008,
                    "message": "La credential asociada fue revocada",
                    "example_params": [],
                    "example_detail": "La credential asociada fue revocada"
                  },
                  {
                    "name": "USER_CUIT_NOT_CONFIGURED",
                    "id": 9,
                    "status": 400,
                    "code": 40001009,
                    "message": "El usuario no tiene un CUIT configurado",
                    "example_params": [],
                    "example_detail": "El usuario no tiene un CUIT configurado"
                  },
                  {
                    "name": "PLATFORM_CREDENTIAL_NOT_CONFIGURED",
                    "id": 10,
                    "status": 503,
                    "code": 50301010,
                    "message": "No hay ninguna credential de plataforma activa configurada",
                    "example_params": [],
                    "example_detail": "No hay ninguna credential de plataforma activa configurada"
                  },
                  {
                    "name": "INVOICE_NOT_REJECTED",
                    "id": 11,
                    "status": 409,
                    "code": 40901011,
                    "message": "Solo se puede reintentar un comprobante REJECTED",
                    "example_params": [],
                    "example_detail": "Solo se puede reintentar un comprobante REJECTED"
                  },
                  {
                    "name": "INVOICE_REJECTED_NO_PDF",
                    "id": 12,
                    "status": 409,
                    "code": 40901012,
                    "message": "Un comprobante REJECTED no tiene PDF (nunca tuvo autorización)",
                    "example_params": [],
                    "example_detail": "Un comprobante REJECTED no tiene PDF (nunca tuvo autorización)"
                  },
                  {
                    "name": "INVOICE_PDF_NOT_SUPPORTED_FOR_SERVICE",
                    "id": 13,
                    "status": 409,
                    "code": 40901013,
                    "message": "El PDF todavía no está soportado para este tipo de comprobante",
                    "example_params": [],
                    "example_detail": "El PDF todavía no está soportado para este tipo de comprobante"
                  },
                  {
                    "name": "INVOICE_NOT_AUTHORIZED",
                    "id": 14,
                    "status": 409,
                    "code": 40901014,
                    "message": "El comprobante no tiene autorización de ARCA todavía",
                    "example_params": [],
                    "example_detail": "El comprobante no tiene autorización de ARCA todavía"
                  },
                  {
                    "name": "INVOICE_NOT_FOUND",
                    "id": 15,
                    "status": 404,
                    "code": 40401015,
                    "message": "Comprobante no encontrado",
                    "example_params": [],
                    "example_detail": "Comprobante no encontrado"
                  },
                  {
                    "name": "TOTAL_AMOUNT_MISMATCH",
                    "id": 16,
                    "status": 400,
                    "code": 40001016,
                    "message": "total_amount debe ser igual a taxable_amount + non_taxable_amount + exempt_amount + vat_amount + other_taxes_amount",
                    "example_params": [],
                    "example_detail": "total_amount debe ser igual a taxable_amount + non_taxable_amount + exempt_amount + vat_amount + other_taxes_amount"
                  },
                  {
                    "name": "VAT_AMOUNT_MISMATCH",
                    "id": 17,
                    "status": 400,
                    "code": 40001017,
                    "message": "vat_amount debe ser igual a la suma de vat_items[].amount",
                    "example_params": [],
                    "example_detail": "vat_amount debe ser igual a la suma de vat_items[].amount"
                  },
                  {
                    "name": "OTHER_TAXES_AMOUNT_MISMATCH",
                    "id": 18,
                    "status": 400,
                    "code": 40001018,
                    "message": "other_taxes_amount debe ser igual a la suma de tax_items[].amount",
                    "example_params": [],
                    "example_detail": "other_taxes_amount debe ser igual a la suma de tax_items[].amount"
                  },
                  {
                    "name": "SERVICE_DATES_REQUIRED",
                    "id": 19,
                    "status": 400,
                    "code": 40001019,
                    "message": "service_start_date, service_end_date y payment_due_date son obligatorios para este concept_type",
                    "example_params": [],
                    "example_detail": "service_start_date, service_end_date y payment_due_date son obligatorios para este concept_type"
                  },
                  {
                    "name": "TOURISM_VOUCHER_ONLY_SURPLUS_ITEMS",
                    "id": 20,
                    "status": 400,
                    "code": 40001020,
                    "message": "Un comprobante de turismo no puede tener únicamente ítems con tourism_code=5 (Excedente)",
                    "example_params": [],
                    "example_detail": "Un comprobante de turismo no puede tener únicamente ítems con tourism_code=5 (Excedente)"
                  },
                  {
                    "name": "ISSUE_DATE_OUT_OF_RANGE",
                    "id": 21,
                    "status": 400,
                    "code": 40001021,
                    "message": "issue_date debe estar dentro de %s días de la fecha actual",
                    "example_params": [
                      "5"
                    ],
                    "example_detail": "issue_date debe estar dentro de 5 días de la fecha actual"
                  },
                  {
                    "name": "CREDENTIAL_NOT_FOUND",
                    "id": 22,
                    "status": 404,
                    "code": 40401022,
                    "message": "Credential no encontrada",
                    "example_params": [],
                    "example_detail": "Credential no encontrada"
                  },
                  {
                    "name": "PLATFORM_CREDENTIAL_ALREADY_EXISTS",
                    "id": 23,
                    "status": 409,
                    "code": 40901023,
                    "message": "Ya existe una credential de plataforma",
                    "example_params": [],
                    "example_detail": "Ya existe una credential de plataforma"
                  },
                  {
                    "name": "PLATFORM_CREDENTIAL_SECRET_NOT_FOUND",
                    "id": 24,
                    "status": 404,
                    "code": 40401024,
                    "message": "No hay clave ni certificado guardados para la credential de plataforma",
                    "example_params": [],
                    "example_detail": "No hay clave ni certificado guardados para la credential de plataforma"
                  },
                  {
                    "name": "PLATFORM_CREDENTIAL_STILL_PENDING",
                    "id": 25,
                    "status": 409,
                    "code": 40901025,
                    "message": "La credential de plataforma todavía no tiene certificado",
                    "example_params": [],
                    "example_detail": "La credential de plataforma todavía no tiene certificado"
                  },
                  {
                    "name": "CREDENTIAL_ALREADY_ACTIVE",
                    "id": 26,
                    "status": 409,
                    "code": 40901026,
                    "message": "La credential ya tiene un certificado activo",
                    "example_params": [],
                    "example_detail": "La credential ya tiene un certificado activo"
                  },
                  {
                    "name": "CREDENTIAL_PENDING_CERT",
                    "id": 27,
                    "status": 403,
                    "code": 40301027,
                    "message": "La credential todavía no tiene certificado (PENDING_CERT)",
                    "example_params": [],
                    "example_detail": "La credential todavía no tiene certificado (PENDING_CERT)"
                  },
                  {
                    "name": "CREDENTIAL_EXPIRED",
                    "id": 28,
                    "status": 403,
                    "code": 40301028,
                    "message": "La credential expiró",
                    "example_params": [],
                    "example_detail": "La credential expiró"
                  },
                  {
                    "name": "PLATFORM_CREDENTIAL_SECRET_EXISTS_USE_RECOVER",
                    "id": 29,
                    "status": 409,
                    "code": 40901029,
                    "message": "La credential de plataforma ya tiene clave y certificado guardados — hay que recuperarla, no pedir un CSR nuevo",
                    "example_params": [],
                    "example_detail": "La credential de plataforma ya tiene clave y certificado guardados — hay que recuperarla, no pedir un CSR nuevo"
                  },
                  {
                    "name": "CREDENTIAL_SECRET_MISSING",
                    "id": 30,
                    "status": 500,
                    "code": 50001030,
                    "message": "La credential existe pero no se encontró su clave privada",
                    "example_params": [],
                    "example_detail": "La credential existe pero no se encontró su clave privada"
                  },
                  {
                    "name": "CERT_DOES_NOT_MATCH_GENERATED_KEY",
                    "id": 31,
                    "status": 400,
                    "code": 40001031,
                    "message": "El certificado no corresponde a la clave generada por este sistema",
                    "example_params": [],
                    "example_detail": "El certificado no corresponde a la clave generada por este sistema"
                  },
                  {
                    "name": "INVALID_CERT_PEM",
                    "id": 32,
                    "status": 400,
                    "code": 40001032,
                    "message": "El PEM del certificado no es válido",
                    "example_params": [],
                    "example_detail": "El PEM del certificado no es válido"
                  },
                  {
                    "name": "USER_NOT_FOUND",
                    "id": 33,
                    "status": 404,
                    "code": 40401033,
                    "message": "Usuario no encontrado",
                    "example_params": [],
                    "example_detail": "Usuario no encontrado"
                  },
                  {
                    "name": "CUIT_ALREADY_CONFIGURED",
                    "id": 34,
                    "status": 409,
                    "code": 40901034,
                    "message": "El usuario ya facturó con este CUIT confirmado por ARCA — ya no se puede modificar",
                    "example_params": [],
                    "example_detail": "El usuario ya facturó con este CUIT confirmado por ARCA — ya no se puede modificar"
                  },
                  {
                    "name": "API_CLIENT_NOT_FOUND",
                    "id": 35,
                    "status": 404,
                    "code": 40401035,
                    "message": "Api Client no encontrado",
                    "example_params": [],
                    "example_detail": "Api Client no encontrado"
                  },
                  {
                    "name": "CONTRIBUYENTE_NOT_FOUND",
                    "id": 36,
                    "status": 404,
                    "code": 40401036,
                    "message": "ARCA no devolvió constancia para este CUIT",
                    "example_params": [],
                    "example_detail": "ARCA no devolvió constancia para este CUIT"
                  },
                  {
                    "name": "MISSING_BEARER_TOKEN",
                    "id": 37,
                    "status": 401,
                    "code": 40101037,
                    "message": "Falta el header Authorization con un Bearer token",
                    "example_params": [],
                    "example_detail": "Falta el header Authorization con un Bearer token"
                  },
                  {
                    "name": "INVALID_TOKEN",
                    "id": 38,
                    "status": 401,
                    "code": 40101038,
                    "message": "El token es inválido o expiró",
                    "example_params": [],
                    "example_detail": "El token es inválido o expiró"
                  },
                  {
                    "name": "SIGNING_KEY_NOT_FOUND",
                    "id": 39,
                    "status": 401,
                    "code": 40101039,
                    "message": "No se encontró la clave pública para verificar el token (kid)",
                    "example_params": [],
                    "example_detail": "No se encontró la clave pública para verificar el token (kid)"
                  },
                  {
                    "name": "JWKS_FETCH_FAILED",
                    "id": 40,
                    "status": 401,
                    "code": 40101040,
                    "message": "No se pudieron obtener las claves públicas para verificar el token",
                    "example_params": [],
                    "example_detail": "No se pudieron obtener las claves públicas para verificar el token"
                  },
                  {
                    "name": "MISSING_API_CLIENT_TOKEN",
                    "id": 41,
                    "status": 401,
                    "code": 40101041,
                    "message": "Falta el header Authorization con un token de Api Client",
                    "example_params": [],
                    "example_detail": "Falta el header Authorization con un token de Api Client"
                  },
                  {
                    "name": "INVALID_API_CLIENT",
                    "id": 42,
                    "status": 401,
                    "code": 40101042,
                    "message": "El Api Client es inválido o fue revocado",
                    "example_params": [],
                    "example_detail": "El Api Client es inválido o fue revocado"
                  },
                  {
                    "name": "CREDENTIAL_STORE_OPERATION_FAILED",
                    "id": 43,
                    "status": 500,
                    "code": 50001043,
                    "message": "No se pudo completar la operación sobre las credenciales guardadas — reintentá más tarde",
                    "example_params": [],
                    "example_detail": "No se pudo completar la operación sobre las credenciales guardadas — reintentá más tarde"
                  },
                  {
                    "name": "ARCA_BUSINESS_ERROR",
                    "id": 44,
                    "status": 500,
                    "code": 50001044,
                    "message": "ARCA rechazó la operación — revisá los datos del comprobante e intentá de nuevo",
                    "example_params": [],
                    "example_detail": "ARCA rechazó la operación — revisá los datos del comprobante e intentá de nuevo"
                  },
                  {
                    "name": "ARCA_HTTP_ERROR",
                    "id": 45,
                    "status": 500,
                    "code": 50001045,
                    "message": "ARCA no está disponible en este momento — reintentá más tarde",
                    "example_params": [],
                    "example_detail": "ARCA no está disponible en este momento — reintentá más tarde"
                  },
                  {
                    "name": "ARCA_UNEXPECTED_RESPONSE",
                    "id": 46,
                    "status": 500,
                    "code": 50001046,
                    "message": "ARCA devolvió una respuesta que no se pudo interpretar — reintentá más tarde",
                    "example_params": [],
                    "example_detail": "ARCA devolvió una respuesta que no se pudo interpretar — reintentá más tarde"
                  },
                  {
                    "name": "API_CLIENT_OPERATION_FAILED",
                    "id": 47,
                    "status": 500,
                    "code": 50001047,
                    "message": "No se pudo completar la operación sobre el API Client — reintentá más tarde",
                    "example_params": [],
                    "example_detail": "No se pudo completar la operación sobre el API Client — reintentá más tarde"
                  },
                  {
                    "name": "ITEMS_REQUIRED_FOR_ITEMIZED_INVOICE",
                    "id": 48,
                    "status": 400,
                    "code": 40001048,
                    "message": "items es obligatorio: el emisor está adherido a RG 2904, este comprobante necesita el detalle de ítems",
                    "example_params": [],
                    "example_detail": "items es obligatorio: el emisor está adherido a RG 2904, este comprobante necesita el detalle de ítems"
                  },
                  {
                    "name": "CBU_SALES_POINT_ALREADY_EXISTS",
                    "id": 49,
                    "status": 409,
                    "code": 40901049,
                    "message": "Este punto de venta ya está marcado como CBU informada para este cliente",
                    "example_params": [],
                    "example_detail": "Este punto de venta ya está marcado como CBU informada para este cliente"
                  },
                  {
                    "name": "CBU_SALES_POINT_NOT_FOUND",
                    "id": 50,
                    "status": 404,
                    "code": 40401050,
                    "message": "No se encontró ese punto de venta marcado como CBU informada",
                    "example_params": [],
                    "example_detail": "No se encontró ese punto de venta marcado como CBU informada"
                  }
                ]
              }
            }
          }
        },
        "summary": "Catálogo completo de errores que puede devolver esta API",
        "tags": [
          "errors"
        ]
      }
    },
    "/users/me": {
      "get": {
        "operationId": "UsersController_me",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Perfil del usuario autenticado, con los datos del padrón de ARCA si ya se consultaron para su CUIT",
        "tags": [
          "users"
        ]
      },
      "patch": {
        "description": "Reenviar el mismo CUIT que ya tenía es un no-op idempotente. Cambiarlo a uno distinto da 409 una vez que el usuario ya facturó y el padrón de ARCA confirmó ese CUIT. `rg2904_adherent` es opcional: si viene, declara o corrige la adhesión a RG 2904 del CUIT propio del usuario.",
        "operationId": "UsersController_updateMe",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "409": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "cuit_already_configured": {
                    "summary": "El usuario ya facturó con este CUIT confirmado por ARCA — ya no se puede modificar",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 409,
                      "detail": "El usuario ya facturó con este CUIT confirmado por ARCA — ya no se puede modificar",
                      "instance": "/...",
                      "code": 40901034
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "platform_credential_not_configured": {
                    "summary": "No hay ninguna credential de plataforma activa configurada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 503,
                      "detail": "No hay ninguna credential de plataforma activa configurada",
                      "instance": "/...",
                      "code": 50301010
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Carga o cambia el CUIT del usuario final para facturar sin certificado propio",
        "tags": [
          "users"
        ]
      }
    },
    "/invoices": {
      "get": {
        "operationId": "InvoicesController_search",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Número de página, arranca en 1. Default: 1.",
            "schema": {
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "size",
            "required": false,
            "in": "query",
            "description": "Cantidad de resultados por página. Default 20, máximo 100 (valores mayores se recortan a 100, nunca rechazan la request).",
            "schema": {
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "represented_cuit_id",
            "required": false,
            "in": "query",
            "description": "Opcional — un contador/usuario en autoservicio lo manda para acotar a un cliente puntual. Si no viene, se listan todas las facturas que el usuario autenticado creó, sin importar el tier.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_from",
            "required": false,
            "in": "query",
            "description": "Filtra por issueDate >= esta fecha.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_to",
            "required": false,
            "in": "query",
            "description": "Filtra por issueDate <= esta fecha.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "PENDING (esperando respuesta de ARCA), APPROVED (CAE otorgado), OBSERVED (CAE otorgado con observaciones) o REJECTED (ARCA no autorizó — reintentable vía POST /invoices/:id/retry).",
            "schema": {
              "type": "string",
              "enum": [
                "PENDING",
                "APPROVED",
                "REJECTED",
                "OBSERVED"
              ]
            }
          },
          {
            "name": "receptor_identification_value",
            "required": false,
            "in": "query",
            "description": "Filtra por a quién se le emitió la factura (identificationValue del receptor, no el CUIT del emisor).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "voucher_type",
            "required": false,
            "in": "query",
            "description": "Código de comprobante de ARCA (ver GET /catalogs/tipos-comprobante), ej. 6=Factura B, 1=Factura A.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sales_point_number",
            "required": false,
            "in": "query",
            "description": "Filtra por punto de venta.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado paginado.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/InvoiceSearchResultDto"
                          }
                        },
                        "meta": {
                          "$ref": "#/components/schemas/SearchMetaDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Lista las facturas del usuario, o de un cliente puntual (contador/autoservicio)",
        "tags": [
          "invoices"
        ]
      },
      "post": {
        "operationId": "InvoicesController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceDto"
              },
              "examples": {
                "factura_b_local": {
                  "summary": "Factura B — local",
                  "description": "Letra A/B/C/M sin adhesión a RG 2904 en el RepresentedCuit.",
                  "value": {
                    "represented_cuit_id": "{{represented_cuit_id}}",
                    "letter": "B",
                    "kind": "FACTURA",
                    "sales_point_number": 1,
                    "concept_type": "PRODUCTS",
                    "receptor": {
                      "identification_category": "NATIONAL_DOCUMENT",
                      "document_type": 80,
                      "identification_value": "20111111112",
                      "tax_condition_id": 5
                    },
                    "issue_date": "2026-09-09",
                    "total_amount": 12100,
                    "taxable_amount": 10000,
                    "non_taxable_amount": 0,
                    "exempt_amount": 0,
                    "vat_amount": 2100,
                    "other_taxes_amount": 0,
                    "currency_code": "PES",
                    "exchange_rate": 1,
                    "items": [
                      {
                        "description": "Producto de ejemplo",
                        "quantity": 2,
                        "unit_of_measure_id": 7,
                        "unit_price": 5000,
                        "amount": 10000
                      }
                    ],
                    "vat_items": [
                      {
                        "vat_rate_id": 5,
                        "taxable_base": 10000,
                        "amount": 2100
                      }
                    ]
                  }
                },
                "factura_b_rg2904": {
                  "summary": "Factura B — emisor adherido a RG 2904",
                  "description": "Body idéntico al del circuito estándar — la diferencia está en el RepresentedCuit (rg2904_adherent=true), nunca en el body. Este circuito exige `items`; el estándar no.",
                  "value": {
                    "represented_cuit_id": "{{represented_cuit_id}}",
                    "letter": "B",
                    "kind": "FACTURA",
                    "sales_point_number": 1,
                    "concept_type": "PRODUCTS",
                    "receptor": {
                      "identification_category": "NATIONAL_DOCUMENT",
                      "document_type": 80,
                      "identification_value": "20111111112",
                      "tax_condition_id": 5
                    },
                    "issue_date": "2026-09-09",
                    "total_amount": 12100,
                    "taxable_amount": 10000,
                    "non_taxable_amount": 0,
                    "exempt_amount": 0,
                    "vat_amount": 2100,
                    "other_taxes_amount": 0,
                    "currency_code": "PES",
                    "exchange_rate": 1,
                    "items": [
                      {
                        "description": "Producto de ejemplo",
                        "quantity": 2,
                        "unit_of_measure_id": 7,
                        "unit_price": 5000,
                        "amount": 10000
                      }
                    ],
                    "vat_items": [
                      {
                        "vat_rate_id": 5,
                        "taxable_base": 10000,
                        "amount": 2100
                      }
                    ]
                  }
                },
                "factura_e_exportacion": {
                  "summary": "Factura E — exportación",
                  "description": "letter=E siempre se procesa como exportación, sin importar rg2904_adherent.",
                  "value": {
                    "represented_cuit_id": "{{represented_cuit_id}}",
                    "letter": "E",
                    "kind": "FACTURA",
                    "sales_point_number": 1,
                    "receptor": {
                      "name": "Foreign Buyer Inc.",
                      "identification_category": "FOREIGN_TAX_ID",
                      "identification_value": "FTX-000111",
                      "country_code": 212,
                      "address": "123 Main St, Miami, FL"
                    },
                    "issue_date": "2026-09-09",
                    "total_amount": 500000,
                    "export": {
                      "export_type": 1,
                      "has_existing_permit": false,
                      "destination_country_code": 212,
                      "currency_code": "DOL",
                      "exchange_rate": 1000,
                      "invoice_language": 1,
                      "items": [
                        {
                          "product_code": "SKU-EXPORT-1",
                          "description": "Producto exportado",
                          "quantity": 10,
                          "unit_of_measure_id": 7,
                          "unit_price": 50000,
                          "amount": 500000
                        }
                      ]
                    }
                  }
                },
                "factura_t_turismo": {
                  "summary": "Factura T — turismo",
                  "description": "letter=T siempre se procesa como turismo, sin importar rg2904_adherent.",
                  "value": {
                    "represented_cuit_id": "{{represented_cuit_id}}",
                    "letter": "T",
                    "kind": "FACTURA",
                    "sales_point_number": 1,
                    "receptor": {
                      "identification_category": "NATIONAL_DOCUMENT",
                      "document_type": 94,
                      "identification_value": "AB123456",
                      "country_code": 212,
                      "address": "123 Main St, Miami, FL"
                    },
                    "issue_date": "2026-09-09",
                    "total_amount": 121000,
                    "tourism": {
                      "emitter_receiver_relation_code": 1,
                      "taxable_amount": 100000,
                      "non_taxable_amount": 0,
                      "exempt_amount": 0,
                      "other_taxes_amount": 0,
                      "reimbursement_amount": 0,
                      "currency_code": "PES",
                      "exchange_rate": 1,
                      "settles_in_same_foreign_currency": false,
                      "items": [
                        {
                          "item_type": 1,
                          "tourism_code": 1,
                          "description": "Hotelería sin desayuno",
                          "vat_rate_id": 5,
                          "vat_amount": 21000,
                          "amount": 121000
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Comprobante persistido — status puede ser APPROVED/OBSERVED/REJECTED según lo que haya decidido ARCA (un REJECTED sigue siendo 201: el comprobante queda guardado). `detail.type` depende de `letter`: STANDARD/ITEMIZED para A/B/C/M (según si el emisor está adherido a RG 2904), EXPORT para E, TOURISM para T — `amounts` es `null` únicamente en EXPORT.",
            "headers": {
              "Location": {
                "description": "Path del comprobante recién creado (regla 180 de rest-api-guidelines).",
                "schema": {
                  "type": "string",
                  "example": "/invoices/b3f1c2a0-1234-4abc-9def-0123456789ab"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponseDto"
                },
                "examples": {
                  "factura_b_aprobada": {
                    "summary": "Factura B — APPROVED",
                    "description": "`detail.type` depende de `voucher.letter`/adhesión a RG 2904: STANDARD (este caso) o ITEMIZED para A/B/C/M, EXPORT para letter=E, TOURISM para letter=T. `amounts` es `null` únicamente en EXPORT.",
                    "value": {
                      "id": "b3f1c2a0-1234-4abc-9def-0123456789ab",
                      "represented_cuit_id": "b1a2c3d4-0000-4000-8000-000000000001",
                      "created_by_user_id": "a0f1e2d3-0000-4000-8000-000000000009",
                      "created_at": "2026-09-09T12:00:00.000Z",
                      "associations": [],
                      "voucher": {
                        "letter": "B",
                        "kind": "FACTURA",
                        "sales_point_number": 1,
                        "number": 124
                      },
                      "issue_date": "2026-09-09T00:00:00.000Z",
                      "total_amount": 12100,
                      "authorization": {
                        "code": "71234567890123",
                        "expires_at": "2026-09-19T00:00:00.000Z"
                      },
                      "status": "APPROVED",
                      "provider_errors": [],
                      "receptor": {
                        "name": null,
                        "identification": {
                          "category": "NATIONAL_DOCUMENT",
                          "value": "20111111112",
                          "document_type": {
                            "id": 80,
                            "label": "CUIT"
                          }
                        },
                        "tax_condition": {
                          "id": 5,
                          "label": "Consumidor Final"
                        },
                        "country_code": null,
                        "address": null
                      },
                      "line_items": [
                        {
                          "description": "Producto de ejemplo",
                          "quantity": 2,
                          "unit_of_measure_id": 7,
                          "unit_price": 5000,
                          "discount_amount": 0,
                          "amount": 10000
                        }
                      ],
                      "vat_items": [
                        {
                          "vat_rate_id": 5,
                          "taxable_base": 10000,
                          "amount": 2100
                        }
                      ],
                      "tax_items": [],
                      "amounts": {
                        "taxable": 10000,
                        "non_taxable": 0,
                        "exempt": 0,
                        "other_taxes": 0,
                        "currency_code": "PES",
                        "exchange_rate": 1
                      },
                      "detail": {
                        "type": "STANDARD",
                        "concept_type": "PRODUCTS",
                        "vat_amount": 2100,
                        "service_start_date": null,
                        "service_end_date": null,
                        "payment_due_date": null
                      }
                    }
                  },
                  "factura_b_rechazada": {
                    "summary": "Factura B — REJECTED por ARCA",
                    "description": "La request pasó nuestras validaciones (400 nunca se llegó a tirar) pero ARCA rechazó el comprobante — sigue siendo 201: un REJECTED es igual un recurso válido, consultable y reintentable vía POST /invoices/:id/retry. `authorization` es `null` mientras no hay CAE (PENDING/REJECTED).",
                    "value": {
                      "id": "b3f1c2a0-1234-4abc-9def-0123456789ab",
                      "represented_cuit_id": "b1a2c3d4-0000-4000-8000-000000000001",
                      "created_by_user_id": "a0f1e2d3-0000-4000-8000-000000000009",
                      "created_at": "2026-09-09T12:00:00.000Z",
                      "associations": [],
                      "voucher": {
                        "letter": "B",
                        "kind": "FACTURA",
                        "sales_point_number": 1,
                        "number": null
                      },
                      "issue_date": "2026-09-09T00:00:00.000Z",
                      "total_amount": 12100,
                      "authorization": null,
                      "status": "REJECTED",
                      "provider_errors": [
                        {
                          "code": "10016",
                          "message": "issue_date está fuera del rango de fechas que acepta ARCA para este comprobante",
                          "type": "error"
                        }
                      ],
                      "receptor": {
                        "name": null,
                        "identification": {
                          "category": "NATIONAL_DOCUMENT",
                          "value": "20111111112",
                          "document_type": {
                            "id": 80,
                            "label": "CUIT"
                          }
                        },
                        "tax_condition": {
                          "id": 5,
                          "label": "Consumidor Final"
                        },
                        "country_code": null,
                        "address": null
                      },
                      "line_items": [],
                      "vat_items": [
                        {
                          "vat_rate_id": 5,
                          "taxable_base": 10000,
                          "amount": 2100
                        }
                      ],
                      "tax_items": [],
                      "amounts": {
                        "taxable": 10000,
                        "non_taxable": 0,
                        "exempt": 0,
                        "other_taxes": 0,
                        "currency_code": "PES",
                        "exchange_rate": 1
                      },
                      "detail": {
                        "type": "STANDARD",
                        "concept_type": "PRODUCTS",
                        "vat_amount": 2100,
                        "service_start_date": null,
                        "service_end_date": null,
                        "payment_due_date": null
                      }
                    }
                  },
                  "factura_e_aprobada": {
                    "summary": "Factura E — APPROVED",
                    "description": "`amounts` es `null` en exportación — no tiene este desglose.",
                    "value": {
                      "id": "b3f1c2a0-1234-4abc-9def-0123456789ab",
                      "represented_cuit_id": "b1a2c3d4-0000-4000-8000-000000000001",
                      "created_by_user_id": "a0f1e2d3-0000-4000-8000-000000000009",
                      "created_at": "2026-09-09T12:00:00.000Z",
                      "associations": [],
                      "voucher": {
                        "letter": "E",
                        "kind": "FACTURA",
                        "sales_point_number": 1,
                        "number": 10
                      },
                      "issue_date": "2026-09-09T00:00:00.000Z",
                      "total_amount": 500000,
                      "authorization": {
                        "code": "88888888888888",
                        "expires_at": "2026-09-19T00:00:00.000Z"
                      },
                      "status": "APPROVED",
                      "provider_errors": [],
                      "receptor": {
                        "name": "Foreign Buyer Inc.",
                        "identification": {
                          "category": "FOREIGN_TAX_ID",
                          "value": "FTX-000111",
                          "document_type": null
                        },
                        "tax_condition": null,
                        "country_code": 212,
                        "address": "123 Main St, Miami, FL"
                      },
                      "line_items": [],
                      "vat_items": [],
                      "tax_items": [],
                      "amounts": null,
                      "detail": {
                        "type": "EXPORT",
                        "arca_request_id": "10",
                        "export_type": 1,
                        "has_existing_permit": false,
                        "destination_country_code": 212,
                        "currency_code": "DOL",
                        "exchange_rate": 1000,
                        "payment_method": null,
                        "incoterms": null,
                        "invoice_language": 1,
                        "payment_due_date": null,
                        "items": [
                          {
                            "product_code": "SKU-EXPORT-1",
                            "description": "Producto exportado",
                            "quantity": 10,
                            "unit_of_measure_id": 7,
                            "unit_price": 50000,
                            "discount_amount": 0,
                            "amount": 500000
                          }
                        ],
                        "permits": []
                      }
                    }
                  },
                  "factura_t_aprobada": {
                    "summary": "Factura T — APPROVED",
                    "value": {
                      "id": "b3f1c2a0-1234-4abc-9def-0123456789ab",
                      "represented_cuit_id": "b1a2c3d4-0000-4000-8000-000000000001",
                      "created_by_user_id": "a0f1e2d3-0000-4000-8000-000000000009",
                      "created_at": "2026-09-09T12:00:00.000Z",
                      "associations": [],
                      "voucher": {
                        "letter": "T",
                        "kind": "FACTURA",
                        "sales_point_number": 1,
                        "number": 6
                      },
                      "issue_date": "2026-09-09T00:00:00.000Z",
                      "total_amount": 121000,
                      "authorization": {
                        "code": "77777777777777",
                        "expires_at": "2026-09-19T00:00:00.000Z"
                      },
                      "status": "APPROVED",
                      "provider_errors": [],
                      "receptor": {
                        "name": null,
                        "identification": {
                          "category": "NATIONAL_DOCUMENT",
                          "value": "AB123456",
                          "document_type": {
                            "id": 94,
                            "label": "Pasaporte"
                          }
                        },
                        "tax_condition": null,
                        "country_code": 212,
                        "address": "123 Main St, Miami, FL"
                      },
                      "line_items": [],
                      "vat_items": [],
                      "tax_items": [],
                      "amounts": {
                        "taxable": 100000,
                        "non_taxable": 0,
                        "exempt": 0,
                        "other_taxes": 0,
                        "currency_code": "PES",
                        "exchange_rate": 1
                      },
                      "detail": {
                        "type": "TOURISM",
                        "authorization_type_code": "E",
                        "emitter_receiver_relation_code": 1,
                        "reimbursement_amount": 0,
                        "settles_in_same_foreign_currency": false,
                        "observations": null,
                        "items": [
                          {
                            "item_type": 1,
                            "tourism_code": 1,
                            "code": null,
                            "description": "Hotelería sin desayuno",
                            "vat_rate_id": 5,
                            "vat_amount": 21000,
                            "amount": 121000
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validación propia (montos, fechas, reglas de negocio) o de class-validator",
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_fields": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "letter must be one of the following values: A, B, C, M, E, T; receptor.identificationValue should not be empty",
                      "instance": "/invoices",
                      "errors": [
                        "letter must be one of the following values: A, B, C, M, E, T",
                        "receptor.identificationValue should not be empty"
                      ]
                    }
                  },
                  "total_amount_mismatch": {
                    "summary": "total_amount debe ser igual a taxable_amount + non_taxable_amount + exempt_amount + vat_amount + other_taxes_amount",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "total_amount debe ser igual a taxable_amount + non_taxable_amount + exempt_amount + vat_amount + other_taxes_amount",
                      "instance": "/...",
                      "code": 40001016
                    }
                  },
                  "vat_amount_mismatch": {
                    "summary": "vat_amount debe ser igual a la suma de vat_items[].amount",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "vat_amount debe ser igual a la suma de vat_items[].amount",
                      "instance": "/...",
                      "code": 40001017
                    }
                  },
                  "other_taxes_amount_mismatch": {
                    "summary": "other_taxes_amount debe ser igual a la suma de tax_items[].amount",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "other_taxes_amount debe ser igual a la suma de tax_items[].amount",
                      "instance": "/...",
                      "code": 40001018
                    }
                  },
                  "service_dates_required": {
                    "summary": "service_start_date, service_end_date y payment_due_date son obligatorios para este concept_type",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "service_start_date, service_end_date y payment_due_date son obligatorios para este concept_type",
                      "instance": "/...",
                      "code": 40001019
                    }
                  },
                  "tourism_voucher_only_surplus_items": {
                    "summary": "Un comprobante de turismo no puede tener únicamente ítems con tourism_code=5 (Excedente)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "Un comprobante de turismo no puede tener únicamente ítems con tourism_code=5 (Excedente)",
                      "instance": "/...",
                      "code": 40001020
                    }
                  },
                  "issue_date_out_of_range": {
                    "summary": "issue_date debe estar dentro de 5 días de la fecha actual",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "issue_date debe estar dentro de 5 días de la fecha actual",
                      "instance": "/...",
                      "code": 40001021
                    }
                  },
                  "items_required_for_itemized_invoice": {
                    "summary": "items es obligatorio: el emisor está adherido a RG 2904, este comprobante necesita el detalle de ítems",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "items es obligatorio: el emisor está adherido a RG 2904, este comprobante necesita el detalle de ítems",
                      "instance": "/...",
                      "code": 40001048
                    }
                  }
                }
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Emite un comprobante — factura, nota de débito o nota de crédito, local (A/B/C/M), de exportación (E) o de turismo (T) según letter/kind",
        "tags": [
          "invoices"
        ]
      }
    },
    "/invoices/{id}": {
      "get": {
        "operationId": "InvoicesController_findById",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id del comprobante.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponseDto"
                },
                "examples": {
                  "factura_b_aprobada": {
                    "summary": "Factura B — APPROVED",
                    "description": "`detail.type` depende de `voucher.letter`/adhesión a RG 2904: STANDARD (este caso) o ITEMIZED para A/B/C/M, EXPORT para letter=E, TOURISM para letter=T. `amounts` es `null` únicamente en EXPORT.",
                    "value": {
                      "id": "b3f1c2a0-1234-4abc-9def-0123456789ab",
                      "represented_cuit_id": "b1a2c3d4-0000-4000-8000-000000000001",
                      "created_by_user_id": "a0f1e2d3-0000-4000-8000-000000000009",
                      "created_at": "2026-09-09T12:00:00.000Z",
                      "associations": [],
                      "voucher": {
                        "letter": "B",
                        "kind": "FACTURA",
                        "sales_point_number": 1,
                        "number": 124
                      },
                      "issue_date": "2026-09-09T00:00:00.000Z",
                      "total_amount": 12100,
                      "authorization": {
                        "code": "71234567890123",
                        "expires_at": "2026-09-19T00:00:00.000Z"
                      },
                      "status": "APPROVED",
                      "provider_errors": [],
                      "receptor": {
                        "name": null,
                        "identification": {
                          "category": "NATIONAL_DOCUMENT",
                          "value": "20111111112",
                          "document_type": {
                            "id": 80,
                            "label": "CUIT"
                          }
                        },
                        "tax_condition": {
                          "id": 5,
                          "label": "Consumidor Final"
                        },
                        "country_code": null,
                        "address": null
                      },
                      "line_items": [
                        {
                          "description": "Producto de ejemplo",
                          "quantity": 2,
                          "unit_of_measure_id": 7,
                          "unit_price": 5000,
                          "discount_amount": 0,
                          "amount": 10000
                        }
                      ],
                      "vat_items": [
                        {
                          "vat_rate_id": 5,
                          "taxable_base": 10000,
                          "amount": 2100
                        }
                      ],
                      "tax_items": [],
                      "amounts": {
                        "taxable": 10000,
                        "non_taxable": 0,
                        "exempt": 0,
                        "other_taxes": 0,
                        "currency_code": "PES",
                        "exchange_rate": 1
                      },
                      "detail": {
                        "type": "STANDARD",
                        "concept_type": "PRODUCTS",
                        "vat_amount": 2100,
                        "service_start_date": null,
                        "service_end_date": null,
                        "payment_due_date": null
                      }
                    }
                  },
                  "factura_b_rechazada": {
                    "summary": "Factura B — REJECTED por ARCA",
                    "description": "La request pasó nuestras validaciones (400 nunca se llegó a tirar) pero ARCA rechazó el comprobante — sigue siendo 201: un REJECTED es igual un recurso válido, consultable y reintentable vía POST /invoices/:id/retry. `authorization` es `null` mientras no hay CAE (PENDING/REJECTED).",
                    "value": {
                      "id": "b3f1c2a0-1234-4abc-9def-0123456789ab",
                      "represented_cuit_id": "b1a2c3d4-0000-4000-8000-000000000001",
                      "created_by_user_id": "a0f1e2d3-0000-4000-8000-000000000009",
                      "created_at": "2026-09-09T12:00:00.000Z",
                      "associations": [],
                      "voucher": {
                        "letter": "B",
                        "kind": "FACTURA",
                        "sales_point_number": 1,
                        "number": null
                      },
                      "issue_date": "2026-09-09T00:00:00.000Z",
                      "total_amount": 12100,
                      "authorization": null,
                      "status": "REJECTED",
                      "provider_errors": [
                        {
                          "code": "10016",
                          "message": "issue_date está fuera del rango de fechas que acepta ARCA para este comprobante",
                          "type": "error"
                        }
                      ],
                      "receptor": {
                        "name": null,
                        "identification": {
                          "category": "NATIONAL_DOCUMENT",
                          "value": "20111111112",
                          "document_type": {
                            "id": 80,
                            "label": "CUIT"
                          }
                        },
                        "tax_condition": {
                          "id": 5,
                          "label": "Consumidor Final"
                        },
                        "country_code": null,
                        "address": null
                      },
                      "line_items": [],
                      "vat_items": [
                        {
                          "vat_rate_id": 5,
                          "taxable_base": 10000,
                          "amount": 2100
                        }
                      ],
                      "tax_items": [],
                      "amounts": {
                        "taxable": 10000,
                        "non_taxable": 0,
                        "exempt": 0,
                        "other_taxes": 0,
                        "currency_code": "PES",
                        "exchange_rate": 1
                      },
                      "detail": {
                        "type": "STANDARD",
                        "concept_type": "PRODUCTS",
                        "vat_amount": 2100,
                        "service_start_date": null,
                        "service_end_date": null,
                        "payment_due_date": null
                      }
                    }
                  },
                  "factura_e_aprobada": {
                    "summary": "Factura E — APPROVED",
                    "description": "`amounts` es `null` en exportación — no tiene este desglose.",
                    "value": {
                      "id": "b3f1c2a0-1234-4abc-9def-0123456789ab",
                      "represented_cuit_id": "b1a2c3d4-0000-4000-8000-000000000001",
                      "created_by_user_id": "a0f1e2d3-0000-4000-8000-000000000009",
                      "created_at": "2026-09-09T12:00:00.000Z",
                      "associations": [],
                      "voucher": {
                        "letter": "E",
                        "kind": "FACTURA",
                        "sales_point_number": 1,
                        "number": 10
                      },
                      "issue_date": "2026-09-09T00:00:00.000Z",
                      "total_amount": 500000,
                      "authorization": {
                        "code": "88888888888888",
                        "expires_at": "2026-09-19T00:00:00.000Z"
                      },
                      "status": "APPROVED",
                      "provider_errors": [],
                      "receptor": {
                        "name": "Foreign Buyer Inc.",
                        "identification": {
                          "category": "FOREIGN_TAX_ID",
                          "value": "FTX-000111",
                          "document_type": null
                        },
                        "tax_condition": null,
                        "country_code": 212,
                        "address": "123 Main St, Miami, FL"
                      },
                      "line_items": [],
                      "vat_items": [],
                      "tax_items": [],
                      "amounts": null,
                      "detail": {
                        "type": "EXPORT",
                        "arca_request_id": "10",
                        "export_type": 1,
                        "has_existing_permit": false,
                        "destination_country_code": 212,
                        "currency_code": "DOL",
                        "exchange_rate": 1000,
                        "payment_method": null,
                        "incoterms": null,
                        "invoice_language": 1,
                        "payment_due_date": null,
                        "items": [
                          {
                            "product_code": "SKU-EXPORT-1",
                            "description": "Producto exportado",
                            "quantity": 10,
                            "unit_of_measure_id": 7,
                            "unit_price": 50000,
                            "discount_amount": 0,
                            "amount": 500000
                          }
                        ],
                        "permits": []
                      }
                    }
                  },
                  "factura_t_aprobada": {
                    "summary": "Factura T — APPROVED",
                    "value": {
                      "id": "b3f1c2a0-1234-4abc-9def-0123456789ab",
                      "represented_cuit_id": "b1a2c3d4-0000-4000-8000-000000000001",
                      "created_by_user_id": "a0f1e2d3-0000-4000-8000-000000000009",
                      "created_at": "2026-09-09T12:00:00.000Z",
                      "associations": [],
                      "voucher": {
                        "letter": "T",
                        "kind": "FACTURA",
                        "sales_point_number": 1,
                        "number": 6
                      },
                      "issue_date": "2026-09-09T00:00:00.000Z",
                      "total_amount": 121000,
                      "authorization": {
                        "code": "77777777777777",
                        "expires_at": "2026-09-19T00:00:00.000Z"
                      },
                      "status": "APPROVED",
                      "provider_errors": [],
                      "receptor": {
                        "name": null,
                        "identification": {
                          "category": "NATIONAL_DOCUMENT",
                          "value": "AB123456",
                          "document_type": {
                            "id": 94,
                            "label": "Pasaporte"
                          }
                        },
                        "tax_condition": null,
                        "country_code": 212,
                        "address": "123 Main St, Miami, FL"
                      },
                      "line_items": [],
                      "vat_items": [],
                      "tax_items": [],
                      "amounts": {
                        "taxable": 100000,
                        "non_taxable": 0,
                        "exempt": 0,
                        "other_taxes": 0,
                        "currency_code": "PES",
                        "exchange_rate": 1
                      },
                      "detail": {
                        "type": "TOURISM",
                        "authorization_type_code": "E",
                        "emitter_receiver_relation_code": 1,
                        "reimbursement_amount": 0,
                        "settles_in_same_foreign_currency": false,
                        "observations": null,
                        "items": [
                          {
                            "item_type": 1,
                            "tourism_code": 1,
                            "code": null,
                            "description": "Hotelería sin desayuno",
                            "vat_rate_id": 5,
                            "vat_amount": 21000,
                            "amount": 121000
                          }
                        ]
                      }
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invoice_not_found": {
                    "summary": "Comprobante no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "Comprobante no encontrado",
                      "instance": "/...",
                      "code": 40401015
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Objeto completo de una factura propia",
        "tags": [
          "invoices"
        ]
      }
    },
    "/invoices/{id}/retry": {
      "post": {
        "operationId": "InvoicesController_retry",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id del comprobante REJECTED a reintentar.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Fila nueva del reintento — nunca la rechazada original.",
            "headers": {
              "Location": {
                "description": "Path del comprobante del reintento (regla 180 de rest-api-guidelines).",
                "schema": {
                  "type": "string",
                  "example": "/invoices/c4a2d3b1-5678-4def-8abc-1234567890cd"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponseDto"
                },
                "examples": {
                  "factura_b_aprobada": {
                    "summary": "Factura B — APPROVED",
                    "description": "`detail.type` depende de `voucher.letter`/adhesión a RG 2904: STANDARD (este caso) o ITEMIZED para A/B/C/M, EXPORT para letter=E, TOURISM para letter=T. `amounts` es `null` únicamente en EXPORT.",
                    "value": {
                      "id": "b3f1c2a0-1234-4abc-9def-0123456789ab",
                      "represented_cuit_id": "b1a2c3d4-0000-4000-8000-000000000001",
                      "created_by_user_id": "a0f1e2d3-0000-4000-8000-000000000009",
                      "created_at": "2026-09-09T12:00:00.000Z",
                      "associations": [],
                      "voucher": {
                        "letter": "B",
                        "kind": "FACTURA",
                        "sales_point_number": 1,
                        "number": 124
                      },
                      "issue_date": "2026-09-09T00:00:00.000Z",
                      "total_amount": 12100,
                      "authorization": {
                        "code": "71234567890123",
                        "expires_at": "2026-09-19T00:00:00.000Z"
                      },
                      "status": "APPROVED",
                      "provider_errors": [],
                      "receptor": {
                        "name": null,
                        "identification": {
                          "category": "NATIONAL_DOCUMENT",
                          "value": "20111111112",
                          "document_type": {
                            "id": 80,
                            "label": "CUIT"
                          }
                        },
                        "tax_condition": {
                          "id": 5,
                          "label": "Consumidor Final"
                        },
                        "country_code": null,
                        "address": null
                      },
                      "line_items": [
                        {
                          "description": "Producto de ejemplo",
                          "quantity": 2,
                          "unit_of_measure_id": 7,
                          "unit_price": 5000,
                          "discount_amount": 0,
                          "amount": 10000
                        }
                      ],
                      "vat_items": [
                        {
                          "vat_rate_id": 5,
                          "taxable_base": 10000,
                          "amount": 2100
                        }
                      ],
                      "tax_items": [],
                      "amounts": {
                        "taxable": 10000,
                        "non_taxable": 0,
                        "exempt": 0,
                        "other_taxes": 0,
                        "currency_code": "PES",
                        "exchange_rate": 1
                      },
                      "detail": {
                        "type": "STANDARD",
                        "concept_type": "PRODUCTS",
                        "vat_amount": 2100,
                        "service_start_date": null,
                        "service_end_date": null,
                        "payment_due_date": null
                      }
                    }
                  },
                  "factura_b_rechazada": {
                    "summary": "Factura B — REJECTED por ARCA",
                    "description": "La request pasó nuestras validaciones (400 nunca se llegó a tirar) pero ARCA rechazó el comprobante — sigue siendo 201: un REJECTED es igual un recurso válido, consultable y reintentable vía POST /invoices/:id/retry. `authorization` es `null` mientras no hay CAE (PENDING/REJECTED).",
                    "value": {
                      "id": "b3f1c2a0-1234-4abc-9def-0123456789ab",
                      "represented_cuit_id": "b1a2c3d4-0000-4000-8000-000000000001",
                      "created_by_user_id": "a0f1e2d3-0000-4000-8000-000000000009",
                      "created_at": "2026-09-09T12:00:00.000Z",
                      "associations": [],
                      "voucher": {
                        "letter": "B",
                        "kind": "FACTURA",
                        "sales_point_number": 1,
                        "number": null
                      },
                      "issue_date": "2026-09-09T00:00:00.000Z",
                      "total_amount": 12100,
                      "authorization": null,
                      "status": "REJECTED",
                      "provider_errors": [
                        {
                          "code": "10016",
                          "message": "issue_date está fuera del rango de fechas que acepta ARCA para este comprobante",
                          "type": "error"
                        }
                      ],
                      "receptor": {
                        "name": null,
                        "identification": {
                          "category": "NATIONAL_DOCUMENT",
                          "value": "20111111112",
                          "document_type": {
                            "id": 80,
                            "label": "CUIT"
                          }
                        },
                        "tax_condition": {
                          "id": 5,
                          "label": "Consumidor Final"
                        },
                        "country_code": null,
                        "address": null
                      },
                      "line_items": [],
                      "vat_items": [
                        {
                          "vat_rate_id": 5,
                          "taxable_base": 10000,
                          "amount": 2100
                        }
                      ],
                      "tax_items": [],
                      "amounts": {
                        "taxable": 10000,
                        "non_taxable": 0,
                        "exempt": 0,
                        "other_taxes": 0,
                        "currency_code": "PES",
                        "exchange_rate": 1
                      },
                      "detail": {
                        "type": "STANDARD",
                        "concept_type": "PRODUCTS",
                        "vat_amount": 2100,
                        "service_start_date": null,
                        "service_end_date": null,
                        "payment_due_date": null
                      }
                    }
                  },
                  "factura_e_aprobada": {
                    "summary": "Factura E — APPROVED",
                    "description": "`amounts` es `null` en exportación — no tiene este desglose.",
                    "value": {
                      "id": "b3f1c2a0-1234-4abc-9def-0123456789ab",
                      "represented_cuit_id": "b1a2c3d4-0000-4000-8000-000000000001",
                      "created_by_user_id": "a0f1e2d3-0000-4000-8000-000000000009",
                      "created_at": "2026-09-09T12:00:00.000Z",
                      "associations": [],
                      "voucher": {
                        "letter": "E",
                        "kind": "FACTURA",
                        "sales_point_number": 1,
                        "number": 10
                      },
                      "issue_date": "2026-09-09T00:00:00.000Z",
                      "total_amount": 500000,
                      "authorization": {
                        "code": "88888888888888",
                        "expires_at": "2026-09-19T00:00:00.000Z"
                      },
                      "status": "APPROVED",
                      "provider_errors": [],
                      "receptor": {
                        "name": "Foreign Buyer Inc.",
                        "identification": {
                          "category": "FOREIGN_TAX_ID",
                          "value": "FTX-000111",
                          "document_type": null
                        },
                        "tax_condition": null,
                        "country_code": 212,
                        "address": "123 Main St, Miami, FL"
                      },
                      "line_items": [],
                      "vat_items": [],
                      "tax_items": [],
                      "amounts": null,
                      "detail": {
                        "type": "EXPORT",
                        "arca_request_id": "10",
                        "export_type": 1,
                        "has_existing_permit": false,
                        "destination_country_code": 212,
                        "currency_code": "DOL",
                        "exchange_rate": 1000,
                        "payment_method": null,
                        "incoterms": null,
                        "invoice_language": 1,
                        "payment_due_date": null,
                        "items": [
                          {
                            "product_code": "SKU-EXPORT-1",
                            "description": "Producto exportado",
                            "quantity": 10,
                            "unit_of_measure_id": 7,
                            "unit_price": 50000,
                            "discount_amount": 0,
                            "amount": 500000
                          }
                        ],
                        "permits": []
                      }
                    }
                  },
                  "factura_t_aprobada": {
                    "summary": "Factura T — APPROVED",
                    "value": {
                      "id": "b3f1c2a0-1234-4abc-9def-0123456789ab",
                      "represented_cuit_id": "b1a2c3d4-0000-4000-8000-000000000001",
                      "created_by_user_id": "a0f1e2d3-0000-4000-8000-000000000009",
                      "created_at": "2026-09-09T12:00:00.000Z",
                      "associations": [],
                      "voucher": {
                        "letter": "T",
                        "kind": "FACTURA",
                        "sales_point_number": 1,
                        "number": 6
                      },
                      "issue_date": "2026-09-09T00:00:00.000Z",
                      "total_amount": 121000,
                      "authorization": {
                        "code": "77777777777777",
                        "expires_at": "2026-09-19T00:00:00.000Z"
                      },
                      "status": "APPROVED",
                      "provider_errors": [],
                      "receptor": {
                        "name": null,
                        "identification": {
                          "category": "NATIONAL_DOCUMENT",
                          "value": "AB123456",
                          "document_type": {
                            "id": 94,
                            "label": "Pasaporte"
                          }
                        },
                        "tax_condition": null,
                        "country_code": 212,
                        "address": "123 Main St, Miami, FL"
                      },
                      "line_items": [],
                      "vat_items": [],
                      "tax_items": [],
                      "amounts": {
                        "taxable": 100000,
                        "non_taxable": 0,
                        "exempt": 0,
                        "other_taxes": 0,
                        "currency_code": "PES",
                        "exchange_rate": 1
                      },
                      "detail": {
                        "type": "TOURISM",
                        "authorization_type_code": "E",
                        "emitter_receiver_relation_code": 1,
                        "reimbursement_amount": 0,
                        "settles_in_same_foreign_currency": false,
                        "observations": null,
                        "items": [
                          {
                            "item_type": 1,
                            "tourism_code": 1,
                            "code": null,
                            "description": "Hotelería sin desayuno",
                            "vat_rate_id": 5,
                            "vat_amount": 21000,
                            "amount": 121000
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invoice_not_found": {
                    "summary": "Comprobante no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "Comprobante no encontrado",
                      "instance": "/...",
                      "code": 40401015
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "409": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invoice_not_rejected": {
                    "summary": "Solo se puede reintentar un comprobante REJECTED",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 409,
                      "detail": "Solo se puede reintentar un comprobante REJECTED",
                      "instance": "/...",
                      "code": 40901011
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Reintenta un REJECTED reconstruyendo la request original — crea una fila nueva",
        "tags": [
          "invoices"
        ]
      }
    },
    "/invoices/{id}/verify": {
      "post": {
        "operationId": "InvoicesController_verify",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id del comprobante a constatar.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyVoucherResponseDto"
                },
                "example": {
                  "result": "A",
                  "observations": [],
                  "errors": []
                }
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invoice_not_found": {
                    "summary": "Comprobante no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "Comprobante no encontrado",
                      "instance": "/...",
                      "code": 40401015
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "409": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invoice_not_authorized": {
                    "summary": "El comprobante no tiene autorización de ARCA todavía",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 409,
                      "detail": "El comprobante no tiene autorización de ARCA todavía",
                      "instance": "/...",
                      "code": 40901014
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Constata que este comprobante coincide con lo que ARCA tiene registrado",
        "tags": [
          "invoices"
        ]
      }
    },
    "/invoices/{id}/pdf": {
      "get": {
        "operationId": "InvoicesController_getPdf",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id del comprobante.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "application/pdf, no JSON"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invoice_not_found": {
                    "summary": "Comprobante no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "Comprobante no encontrado",
                      "instance": "/...",
                      "code": 40401015
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "409": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invoice_rejected_no_pdf": {
                    "summary": "Un comprobante REJECTED no tiene PDF (nunca tuvo autorización)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 409,
                      "detail": "Un comprobante REJECTED no tiene PDF (nunca tuvo autorización)",
                      "instance": "/...",
                      "code": 40901012
                    }
                  },
                  "invoice_pdf_not_supported_for_service": {
                    "summary": "El PDF todavía no está soportado para este tipo de comprobante",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 409,
                      "detail": "El PDF todavía no está soportado para este tipo de comprobante",
                      "instance": "/...",
                      "code": 40901013
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "PDF del comprobante — no disponible para todos los tipos de factura",
        "tags": [
          "invoices"
        ]
      }
    },
    "/credentials": {
      "get": {
        "operationId": "CredentialsController_search",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Número de página, arranca en 1. Default: 1.",
            "schema": {
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "size",
            "required": false,
            "in": "query",
            "description": "Cantidad de resultados por página. Default 20, máximo 100 (valores mayores se recortan a 100, nunca rechazan la request).",
            "schema": {
              "minimum": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado paginado.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CredentialSearchResultDto"
                          }
                        },
                        "meta": {
                          "$ref": "#/components/schemas/SearchMetaDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Lista las credenciales (certificados ARCA) del usuario autenticado",
        "tags": [
          "credentials"
        ]
      }
    },
    "/credentials/csr": {
      "post": {
        "description": "El servidor SIEMPRE genera la clave privada acá — nunca se acepta una subida directa de clave privada. Sin body: usa el CUIT ya configurado en el perfil (PATCH /users/me tiene que haberse llamado antes) y la razón social/nombre que haya en el padrón para ese CUIT.",
        "operationId": "CredentialsController_requestCsr",
        "parameters": [],
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CsrResponseDto"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "user_cuit_not_configured": {
                    "summary": "El usuario no tiene un CUIT configurado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El usuario no tiene un CUIT configurado",
                      "instance": "/...",
                      "code": 40001009
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Genera un par de claves + CSR (paso 1 de 2) — pegar el CSR en ARCA para obtener el .crt",
        "tags": [
          "credentials"
        ]
      }
    },
    "/credentials/{id}/certificate": {
      "post": {
        "operationId": "CredentialsController_uploadCertificate",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Credential creada en el paso 1 (POST /credentials/csr).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadCertificateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialResponseDto"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "cert_does_not_match_generated_key": {
                    "summary": "El certificado no corresponde a la clave generada por este sistema",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El certificado no corresponde a la clave generada por este sistema",
                      "instance": "/...",
                      "code": 40001031
                    }
                  },
                  "invalid_cert_pem": {
                    "summary": "El PEM del certificado no es válido",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El PEM del certificado no es válido",
                      "instance": "/...",
                      "code": 40001032
                    }
                  },
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_revoked": {
                    "summary": "La credential asociada fue revocada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 403,
                      "detail": "La credential asociada fue revocada",
                      "instance": "/...",
                      "code": 40301008
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_not_found": {
                    "summary": "Credential no encontrada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "Credential no encontrada",
                      "instance": "/...",
                      "code": 40401022
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "409": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_already_active": {
                    "summary": "La credential ya tiene un certificado activo",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 409,
                      "detail": "La credential ya tiene un certificado activo",
                      "instance": "/...",
                      "code": 40901026
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "500": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_secret_missing": {
                    "summary": "La credential existe pero no se encontró su clave privada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 500,
                      "detail": "La credential existe pero no se encontró su clave privada",
                      "instance": "/...",
                      "code": 50001030
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Completa la credential con el .crt que devolvió AFIP (paso 2 de 2)",
        "tags": [
          "credentials"
        ]
      }
    },
    "/credentials/{id}": {
      "get": {
        "operationId": "CredentialsController_findById",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id de la credential.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialResponseDto"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_not_found": {
                    "summary": "Credential no encontrada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "Credential no encontrada",
                      "instance": "/...",
                      "code": 40401022
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Datos de una credential propia (nunca incluye la clave privada)",
        "tags": [
          "credentials"
        ]
      },
      "delete": {
        "operationId": "CredentialsController_revoke",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id de la credential a revocar.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_not_found": {
                    "summary": "Credential no encontrada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "Credential no encontrada",
                      "instance": "/...",
                      "code": 40401022
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Revoca una credential — no se puede volver a usar para firmar contra ARCA",
        "tags": [
          "credentials"
        ]
      }
    },
    "/represented-cuits": {
      "get": {
        "operationId": "RepresentedCuitsController_search",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Número de página, arranca en 1. Default: 1.",
            "schema": {
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "size",
            "required": false,
            "in": "query",
            "description": "Cantidad de resultados por página. Default 20, máximo 100 (valores mayores se recortan a 100, nunca rechazan la request).",
            "schema": {
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "credential_id",
            "required": true,
            "in": "query",
            "description": "Credential bajo la cual buscar los CUITs (propio + delegados).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "required": false,
            "in": "query",
            "description": "Texto libre — busca por coincidencia parcial contra CUIT, etiqueta, razón social, nombre y apellido. No matchea contra campos de padrón que todavía están en null (ver GET /represented-cuits).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado paginado.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/RepresentedCuitSearchResultDto"
                          }
                        },
                        "meta": {
                          "$ref": "#/components/schemas/SearchMetaDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Lista los CUITs (propio + delegados) bajo una credential, con los datos del padrón de ARCA si ya se consultaron para cada uno",
        "tags": [
          "represented-cuits"
        ]
      },
      "post": {
        "description": "El sistema no puede verificar que la delegación exista del lado de ARCA, solo la registra — si no está hecha, POST /invoices va a rechazar con \"CUIT representada no incluida en token\". Dispara best-effort (nunca bloquea esta respuesta si falla) la consulta al padrón de ARCA para este CUIT y persiste ese snapshot en el propio cliente, para que listarlos después no necesite volver a consultarlo.",
        "operationId": "RepresentedCuitsController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRepresentedCuitDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepresentedCuitResponseDto"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Agrega un CUIT delegado bajo una credential (modo contador)",
        "tags": [
          "represented-cuits"
        ]
      }
    },
    "/represented-cuits/{id}": {
      "patch": {
        "description": "Los 2 campos editables después de crear, cada uno independiente (mandar solo uno deja el otro sin tocar). `rg2904_adherent` lo declara el usuario (ARCA no lo informa por ninguna vía consultable) y puede haberse cargado mal al alta — antes de este endpoint la única forma de corregirlo era borrar y crear de nuevo el CUIT delegado, pero eso es imposible en cuanto ya facturó algo (DELETE devuelve 409 REPRESENTED_CUIT_HAS_INVOICES); cambiarlo solo afecta comprobantes emitidos DESPUÉS de este PATCH. `default_sales_point_number` es pura conveniencia de UI (preseleccionar el punto de venta en \"Emitir factura\") — nunca se usa server-side, acepta `null` para quitarlo.",
        "operationId": "RepresentedCuitsController_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id del CUIT (propio o delegado) a corregir.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRepresentedCuitDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepresentedCuitResponseDto"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Corrige la adhesión a RG 2904 y/o el punto de venta default de un CUIT (propio o delegado)",
        "tags": [
          "represented-cuits"
        ]
      },
      "delete": {
        "operationId": "RepresentedCuitsController_delete",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id del CUIT delegado a quitar.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "cannot_delete_self_represented_cuit": {
                    "summary": "No se puede eliminar el RepresentedCuit propio (isSelf) de una credential",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "No se puede eliminar el RepresentedCuit propio (isSelf) de una credential",
                      "instance": "/...",
                      "code": 40001005
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "409": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_has_invoices": {
                    "summary": "No se puede eliminar el RepresentedCuit: tiene comprobantes asociados",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 409,
                      "detail": "No se puede eliminar el RepresentedCuit: tiene comprobantes asociados",
                      "instance": "/...",
                      "code": 40901006
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Quita un CUIT delegado — nunca el propio (isSelf)",
        "tags": [
          "represented-cuits"
        ]
      }
    },
    "/represented-cuits/{id}/cbu-informada-sales-points": {
      "post": {
        "description": "ARCA no informa esta relación por ninguna vía consultable — el contribuyente tiene que haber dado de alta este punto de venta para esta modalidad directamente en ARCA primero (servicio REAR/RECE/RFI); esto solo le dice a esta API qué punto de venta imprimir con esa leyenda en el PDF.",
        "operationId": "RepresentedCuitsController_createCbuInformadaSalesPoint",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id del CUIT (propio o delegado).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCbuInformadaSalesPointDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CbuInformadaSalesPointResponseDto"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "409": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "cbu_sales_point_already_exists": {
                    "summary": "Este punto de venta ya está marcado como CBU informada para este cliente",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 409,
                      "detail": "Este punto de venta ya está marcado como CBU informada para este cliente",
                      "instance": "/...",
                      "code": 40901049
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Marca un punto de venta para la modalidad \"Factura A con leyenda Pago en CBU informada\" (RG 5762/2025)",
        "tags": [
          "represented-cuits"
        ]
      },
      "get": {
        "operationId": "RepresentedCuitsController_findCbuInformadaSalesPoints",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id del CUIT (propio o delegado).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CbuInformadaSalesPointResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Lista los puntos de venta marcados como CBU informada de un CUIT",
        "tags": [
          "represented-cuits"
        ]
      }
    },
    "/represented-cuits/{id}/cbu-informada-sales-points/{salesPointNumber}": {
      "patch": {
        "description": "Único campo editable después de marcar un punto de venta — para cambiar el número de punto de venta en sí hay que desmarcarlo y marcar el nuevo. `cbu` acepta `null` para quitarlo sin desmarcar el punto (la leyenda se sigue imprimiendo igual, solo sin el número de cuenta).",
        "operationId": "RepresentedCuitsController_updateCbuInformadaSalesPoint",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id del CUIT (propio o delegado).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "salesPointNumber",
            "required": true,
            "in": "path",
            "description": "Número de punto de venta a corregir.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCbuInformadaSalesPointDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CbuInformadaSalesPointResponseDto"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  },
                  "cbu_sales_point_not_found": {
                    "summary": "No se encontró ese punto de venta marcado como CBU informada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "No se encontró ese punto de venta marcado como CBU informada",
                      "instance": "/...",
                      "code": 40401050
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Corrige el CBU de un punto de venta ya marcado como CBU informada",
        "tags": [
          "represented-cuits"
        ]
      },
      "delete": {
        "operationId": "RepresentedCuitsController_deleteCbuInformadaSalesPoint",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id del CUIT (propio o delegado).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "salesPointNumber",
            "required": true,
            "in": "path",
            "description": "Número de punto de venta a desmarcar.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  },
                  "cbu_sales_point_not_found": {
                    "summary": "No se encontró ese punto de venta marcado como CBU informada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "No se encontró ese punto de venta marcado como CBU informada",
                      "instance": "/...",
                      "code": 40401050
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Desmarca un punto de venta de la modalidad CBU informada",
        "tags": [
          "represented-cuits"
        ]
      }
    },
    "/voucher-verifications": {
      "post": {
        "operationId": "VoucherVerificationController_verify",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyVoucherDto"
              },
              "examples": {
                "verify_third_party_invoice": {
                  "summary": "Constatar una factura de un tercero (ej. de un proveedor)",
                  "value": {
                    "represented_cuit_id": "{{represented_cuit_id}}",
                    "issuer_cuit": "20222222223",
                    "sales_point_number": 1,
                    "voucher_type": 6,
                    "voucher_number": 124,
                    "issue_date": "2026-09-09",
                    "total_amount": 12100,
                    "authorization_code": "71234567890123"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyVoucherResponseDto"
                },
                "examples": {
                  "autorizado": {
                    "summary": "Comprobante autorizado",
                    "value": {
                      "result": "A",
                      "observations": [],
                      "errors": []
                    }
                  },
                  "rechazado": {
                    "summary": "Comprobante rechazado",
                    "value": {
                      "result": "R",
                      "observations": [
                        {
                          "code": 102,
                          "message": "El importe no coincide"
                        }
                      ],
                      "errors": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Constata cualquier comprobante autorizado (con CAE/CAI/CAEA), incluido uno emitido fuera de este sistema",
        "tags": [
          "voucher-verification"
        ]
      }
    },
    "/padron/{cuit}": {
      "get": {
        "description": "Público dentro de la plataforma: no está scoped al usuario autenticado, cualquiera puede consultar cualquier CUIT/CUIL. 404 si ARCA no reconoce ese CUIT como un contribuyente real.",
        "operationId": "PadronController_getContribuyente",
        "parameters": [
          {
            "name": "cuit",
            "required": true,
            "in": "path",
            "description": "CUIT o CUIL a consultar (11 dígitos, sin guiones).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContribuyenteResponseDto"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "contribuyente_not_found": {
                    "summary": "ARCA no devolvió constancia para este CUIT",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "ARCA no devolvió constancia para este CUIT",
                      "instance": "/...",
                      "code": 40401036
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Consulta en vivo el padrón de ARCA para previsualizar los datos de un contribuyente",
        "tags": [
          "padron"
        ]
      }
    },
    "/catalogs/provincias": {
      "get": {
        "description": "Provincias argentinas (más CABA), con su código y nombre. Sin uso directo en esta API todavía — expuesto de referencia.",
        "operationId": "CatalogsController_getProvincias",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StaticCatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "codigo": 0,
                    "descripcion": "Ciudad Autónoma de Buenos Aires"
                  },
                  {
                    "codigo": 1,
                    "descripcion": "Buenos Aires"
                  },
                  {
                    "codigo": 3,
                    "descripcion": "Córdoba"
                  }
                ]
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Provincias",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/tipos-responsable": {
      "get": {
        "description": "1=Responsable Inscripto, 5=Consumidor Final, 6=Monotributo, etc. Usado en `receptor.tax_condition` de POST /invoices.",
        "operationId": "CatalogsController_getTiposResponsable",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StaticCatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "codigo": 1,
                    "descripcion": "IVA Responsable Inscripto"
                  },
                  {
                    "codigo": 5,
                    "descripcion": "Consumidor Final"
                  },
                  {
                    "codigo": 6,
                    "descripcion": "Responsable Monotributo"
                  }
                ]
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Condición frente al IVA",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/tipos-documento": {
      "get": {
        "description": "CUIT, CUIL, DNI, Pasaporte, etc. Usado en `receptor.identification.document_type` de POST /invoices y `receptor_document_type` de POST /voucher-verifications.",
        "operationId": "CatalogsController_getTiposDocumento",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StaticCatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "codigo": 80,
                    "descripcion": "CUIT"
                  },
                  {
                    "codigo": 94,
                    "descripcion": "Pasaporte"
                  },
                  {
                    "codigo": 96,
                    "descripcion": "DNI"
                  }
                ]
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Tipos de documento de identidad",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/idiomas": {
      "get": {
        "description": "Usado en `export.invoice_language` de POST /invoices (exportación).",
        "operationId": "CatalogsController_getIdiomas",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StaticCatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "codigo": 1,
                    "descripcion": "Español"
                  },
                  {
                    "codigo": 2,
                    "descripcion": "Inglés"
                  },
                  {
                    "codigo": 3,
                    "descripcion": "Portugués"
                  }
                ]
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Idiomas del comprobante",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/incoterms": {
      "get": {
        "description": "EXW, FOB, CIF, etc. Usado en `export.incoterms` de POST /invoices (exportación).",
        "operationId": "CatalogsController_getIncoterms",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StaticCatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "codigo": "EXW",
                    "descripcion": "Ex Works"
                  },
                  {
                    "codigo": "FOB",
                    "descripcion": "Free On Board"
                  },
                  {
                    "codigo": "CIF",
                    "descripcion": "Cost, Insurance and Freight"
                  }
                ]
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Incoterms",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/unidad-medida": {
      "get": {
        "description": "Kg, metros, litros, etc. Usado en `items[].unit_of_measure_id` de POST /invoices (cualquier familia con renglones de detalle).",
        "operationId": "CatalogsController_getUnidadMedida",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StaticCatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "codigo": "01",
                    "descripcion": "KILOGRAMO"
                  },
                  {
                    "codigo": "02",
                    "descripcion": "METROS"
                  },
                  {
                    "codigo": "07",
                    "descripcion": "UNIDAD"
                  }
                ]
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Unidades de medida",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/cuit-pais": {
      "get": {
        "description": "Identificador genérico que ARCA asigna a cada país para clientes del exterior. Usado en `receptor.identification.value` de POST /invoices cuando `identification.category=FOREIGN_TAX_ID` (exportación/turismo).",
        "operationId": "CatalogsController_getCuitPais",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CuitPaisResponseDto"
                  }
                },
                "example": [
                  {
                    "cuit_pais": "50000000024",
                    "descripcion": "PARAGUAY",
                    "codigo_tipo_sujeto": 1
                  },
                  {
                    "cuit_pais": "50000002124",
                    "descripcion": "ESTADOS UNIDOS",
                    "codigo_tipo_sujeto": 1
                  }
                ]
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "CUIT genérico por país",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/operacion-condicion-iva": {
      "get": {
        "description": "Alícuotas y valores como \"No Corresponde\"/\"Exento\"/\"Gravado\". Tabla legado de AFIP, sin uso directo en esta API — expuesta de referencia.",
        "operationId": "CatalogsController_getOperacionCondicionIva",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StaticCatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "codigo": 2,
                    "descripcion": "Exento",
                    "observaciones": null
                  },
                  {
                    "codigo": 4,
                    "descripcion": "10.5%",
                    "observaciones": null
                  },
                  {
                    "codigo": 5,
                    "descripcion": "21%",
                    "observaciones": null
                  }
                ]
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Condición IVA/operación (tabla legado)",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/tipos-comprobante": {
      "get": {
        "description": "1=Factura A, 6=Factura B, 11=Factura C, etc. Usado en `GET /invoices?voucher_type`, `associations[].related_voucher_type` (nota de crédito/débito) y `voucher_type` de POST /voucher-verifications.",
        "operationId": "CatalogsController_getTiposComprobante",
        "parameters": [
          {
            "name": "represented_cuit_id",
            "required": false,
            "in": "query",
            "description": "Solo para un contador o usuario en autoservicio que factura por varios clientes — elige con cuál credential consultar el catálogo. Un usuario final nunca lo manda: se resuelve solo contra su propio certificado, o contra el certificado de la plataforma si no tiene uno propio.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "description": "Factura A",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": 6,
                    "description": "Factura B",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": 11,
                    "description": "Factura C",
                    "start_date": "2010-01-01",
                    "end_date": null
                  }
                ]
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "user_cuit_not_configured": {
                    "summary": "El usuario no tiene un CUIT configurado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El usuario no tiene un CUIT configurado",
                      "instance": "/...",
                      "code": 40001009
                    }
                  },
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_revoked": {
                    "summary": "La credential asociada fue revocada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 403,
                      "detail": "La credential asociada fue revocada",
                      "instance": "/...",
                      "code": 40301008
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "platform_credential_not_configured": {
                    "summary": "No hay ninguna credential de plataforma activa configurada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 503,
                      "detail": "No hay ninguna credential de plataforma activa configurada",
                      "instance": "/...",
                      "code": 50301010
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Tipos de comprobante",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/alicuotas-iva": {
      "get": {
        "description": "Usado en `vat_items[].vat_rate_id` de POST /invoices y en `tourism.items[].vat_rate_id`.",
        "operationId": "CatalogsController_getAlicuotasIva",
        "parameters": [
          {
            "name": "represented_cuit_id",
            "required": false,
            "in": "query",
            "description": "Solo para un contador o usuario en autoservicio que factura por varios clientes — elige con cuál credential consultar el catálogo. Un usuario final nunca lo manda: se resuelve solo contra su propio certificado, o contra el certificado de la plataforma si no tiene uno propio.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "id": 3,
                    "description": "0%",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": 4,
                    "description": "10.5%",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": 5,
                    "description": "21%",
                    "start_date": "2010-01-01",
                    "end_date": null
                  }
                ]
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "user_cuit_not_configured": {
                    "summary": "El usuario no tiene un CUIT configurado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El usuario no tiene un CUIT configurado",
                      "instance": "/...",
                      "code": 40001009
                    }
                  },
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_revoked": {
                    "summary": "La credential asociada fue revocada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 403,
                      "detail": "La credential asociada fue revocada",
                      "instance": "/...",
                      "code": 40301008
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "platform_credential_not_configured": {
                    "summary": "No hay ninguna credential de plataforma activa configurada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 503,
                      "detail": "No hay ninguna credential de plataforma activa configurada",
                      "instance": "/...",
                      "code": 50301010
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Alícuotas de IVA",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/tipos-documento-receptor": {
      "get": {
        "description": "80=CUIT, 96=DNI, etc. Usado en `receptor.identification.document_type` de POST /invoices y `receptor_document_type` de POST /voucher-verifications. Complementa GET /catalogs/tipos-documento (esa es una tabla local de mantenimiento manual; esta siempre está actualizada).",
        "operationId": "CatalogsController_getTiposDocumentoReceptor",
        "parameters": [
          {
            "name": "represented_cuit_id",
            "required": false,
            "in": "query",
            "description": "Solo para un contador o usuario en autoservicio que factura por varios clientes — elige con cuál credential consultar el catálogo. Un usuario final nunca lo manda: se resuelve solo contra su propio certificado, o contra el certificado de la plataforma si no tiene uno propio.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "id": 80,
                    "description": "CUIT",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": 96,
                    "description": "DNI",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": 99,
                    "description": "Consumidor Final",
                    "start_date": "2010-01-01",
                    "end_date": null
                  }
                ]
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "user_cuit_not_configured": {
                    "summary": "El usuario no tiene un CUIT configurado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El usuario no tiene un CUIT configurado",
                      "instance": "/...",
                      "code": 40001009
                    }
                  },
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_revoked": {
                    "summary": "La credential asociada fue revocada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 403,
                      "detail": "La credential asociada fue revocada",
                      "instance": "/...",
                      "code": 40301008
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "platform_credential_not_configured": {
                    "summary": "No hay ninguna credential de plataforma activa configurada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 503,
                      "detail": "No hay ninguna credential de plataforma activa configurada",
                      "instance": "/...",
                      "code": 50301010
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Tipos de documento del receptor",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/monedas": {
      "get": {
        "description": "Usado en `currency_code` de POST /invoices (facturas locales, de exportación y de turismo).",
        "operationId": "CatalogsController_getMonedas",
        "parameters": [
          {
            "name": "represented_cuit_id",
            "required": false,
            "in": "query",
            "description": "Solo para un contador o usuario en autoservicio que factura por varios clientes — elige con cuál credential consultar el catálogo. Un usuario final nunca lo manda: se resuelve solo contra su propio certificado, o contra el certificado de la plataforma si no tiene uno propio.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "id": "PES",
                    "description": "Pesos Argentinos",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": "DOL",
                    "description": "Dolar Estadounidense",
                    "start_date": "2010-01-01",
                    "end_date": null
                  }
                ]
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "user_cuit_not_configured": {
                    "summary": "El usuario no tiene un CUIT configurado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El usuario no tiene un CUIT configurado",
                      "instance": "/...",
                      "code": 40001009
                    }
                  },
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_revoked": {
                    "summary": "La credential asociada fue revocada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 403,
                      "detail": "La credential asociada fue revocada",
                      "instance": "/...",
                      "code": 40301008
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "platform_credential_not_configured": {
                    "summary": "No hay ninguna credential de plataforma activa configurada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 503,
                      "detail": "No hay ninguna credential de plataforma activa configurada",
                      "instance": "/...",
                      "code": 50301010
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Códigos de moneda",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/puntos-venta": {
      "get": {
        "description": "Puntos de venta habilitados para el CUIT consultado (se dan de alta en el portal de AFIP, no vía esta API). Usado en `sales_point_number` de POST /invoices, GET /invoices y POST /voucher-verifications.",
        "operationId": "CatalogsController_getPuntosVenta",
        "parameters": [
          {
            "name": "represented_cuit_id",
            "required": false,
            "in": "query",
            "description": "Solo para un contador o usuario en autoservicio que factura por varios clientes — elige con cuál credential consultar el catálogo. Un usuario final nunca lo manda: se resuelve solo contra su propio certificado, o contra el certificado de la plataforma si no tiene uno propio.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SalesPointResponseDto"
                  }
                },
                "example": [
                  {
                    "number": 1,
                    "emission_type": "CAE",
                    "blocked": false,
                    "deactivated_at": null
                  },
                  {
                    "number": 2,
                    "emission_type": "CAEA",
                    "blocked": false,
                    "deactivated_at": null
                  }
                ]
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "user_cuit_not_configured": {
                    "summary": "El usuario no tiene un CUIT configurado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El usuario no tiene un CUIT configurado",
                      "instance": "/...",
                      "code": 40001009
                    }
                  },
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_revoked": {
                    "summary": "La credential asociada fue revocada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 403,
                      "detail": "La credential asociada fue revocada",
                      "instance": "/...",
                      "code": 40301008
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "platform_credential_not_configured": {
                    "summary": "No hay ninguna credential de plataforma activa configurada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 503,
                      "detail": "No hay ninguna credential de plataforma activa configurada",
                      "instance": "/...",
                      "code": 50301010
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Puntos de venta",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/conceptos": {
      "get": {
        "description": "Productos/servicios/ambos. Esta API declara el concepto directo como `concept_type` (PRODUCTS/SERVICES/PRODUCTS_AND_SERVICES) en POST /invoices, sin pasar por este catálogo — expuesto solo de referencia.",
        "operationId": "CatalogsController_getConceptos",
        "parameters": [
          {
            "name": "represented_cuit_id",
            "required": false,
            "in": "query",
            "description": "Solo para un contador o usuario en autoservicio que factura por varios clientes — elige con cuál credential consultar el catálogo. Un usuario final nunca lo manda: se resuelve solo contra su propio certificado, o contra el certificado de la plataforma si no tiene uno propio.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "description": "Productos",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": 2,
                    "description": "Servicios",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": 3,
                    "description": "Productos y Servicios",
                    "start_date": "2010-01-01",
                    "end_date": null
                  }
                ]
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "user_cuit_not_configured": {
                    "summary": "El usuario no tiene un CUIT configurado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El usuario no tiene un CUIT configurado",
                      "instance": "/...",
                      "code": 40001009
                    }
                  },
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_revoked": {
                    "summary": "La credential asociada fue revocada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 403,
                      "detail": "La credential asociada fue revocada",
                      "instance": "/...",
                      "code": 40301008
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "platform_credential_not_configured": {
                    "summary": "No hay ninguna credential de plataforma activa configurada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 503,
                      "detail": "No hay ninguna credential de plataforma activa configurada",
                      "instance": "/...",
                      "code": 50301010
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Conceptos",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/tipos-tributo": {
      "get": {
        "description": "Usado en `tax_items[].tax_type_id` de POST /invoices.",
        "operationId": "CatalogsController_getTiposTributo",
        "parameters": [
          {
            "name": "represented_cuit_id",
            "required": false,
            "in": "query",
            "description": "Solo para un contador o usuario en autoservicio que factura por varios clientes — elige con cuál credential consultar el catálogo. Un usuario final nunca lo manda: se resuelve solo contra su propio certificado, o contra el certificado de la plataforma si no tiene uno propio.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "description": "Impuestos Nacionales",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": 3,
                    "description": "Impuestos Municipales",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": 99,
                    "description": "Otro",
                    "start_date": "2010-01-01",
                    "end_date": null
                  }
                ]
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "user_cuit_not_configured": {
                    "summary": "El usuario no tiene un CUIT configurado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El usuario no tiene un CUIT configurado",
                      "instance": "/...",
                      "code": 40001009
                    }
                  },
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_revoked": {
                    "summary": "La credential asociada fue revocada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 403,
                      "detail": "La credential asociada fue revocada",
                      "instance": "/...",
                      "code": 40301008
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "platform_credential_not_configured": {
                    "summary": "No hay ninguna credential de plataforma activa configurada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 503,
                      "detail": "No hay ninguna credential de plataforma activa configurada",
                      "instance": "/...",
                      "code": 50301010
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Tipos de tributo",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/condiciones-iva-receptor": {
      "get": {
        "description": "Vigente desde RG 5616. Usado en `receptor.tax_condition` de POST /invoices. Complementa GET /catalogs/tipos-responsable (esa es la tabla legado de mantenimiento manual; esta siempre está actualizada).",
        "operationId": "CatalogsController_getCondicionesIvaReceptor",
        "parameters": [
          {
            "name": "represented_cuit_id",
            "required": false,
            "in": "query",
            "description": "Solo para un contador o usuario en autoservicio que factura por varios clientes — elige con cuál credential consultar el catálogo. Un usuario final nunca lo manda: se resuelve solo contra su propio certificado, o contra el certificado de la plataforma si no tiene uno propio.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "description": "IVA Responsable Inscripto",
                    "start_date": "2022-01-01",
                    "end_date": null
                  },
                  {
                    "id": 5,
                    "description": "Consumidor Final",
                    "start_date": "2022-01-01",
                    "end_date": null
                  },
                  {
                    "id": 6,
                    "description": "Responsable Monotributo",
                    "start_date": "2022-01-01",
                    "end_date": null
                  }
                ]
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "user_cuit_not_configured": {
                    "summary": "El usuario no tiene un CUIT configurado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El usuario no tiene un CUIT configurado",
                      "instance": "/...",
                      "code": 40001009
                    }
                  },
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_revoked": {
                    "summary": "La credential asociada fue revocada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 403,
                      "detail": "La credential asociada fue revocada",
                      "instance": "/...",
                      "code": 40301008
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "platform_credential_not_configured": {
                    "summary": "No hay ninguna credential de plataforma activa configurada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 503,
                      "detail": "No hay ninguna credential de plataforma activa configurada",
                      "instance": "/...",
                      "code": 50301010
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Condición frente al IVA del receptor",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/campos-opcionales": {
      "get": {
        "description": "Campos opcionales que ARCA admite en un comprobante. Sin uso directo en esta API todavía — expuesto de referencia para quien necesite mandar uno que esta API no modela explícitamente.",
        "operationId": "CatalogsController_getCamposOpcionales",
        "parameters": [
          {
            "name": "represented_cuit_id",
            "required": false,
            "in": "query",
            "description": "Solo para un contador o usuario en autoservicio que factura por varios clientes — elige con cuál credential consultar el catálogo. Un usuario final nunca lo manda: se resuelve solo contra su propio certificado, o contra el certificado de la plataforma si no tiene uno propio.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "id": "17",
                    "description": "Fecha Vto Servicio",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": "22",
                    "description": "CBU",
                    "start_date": "2010-01-01",
                    "end_date": null
                  }
                ]
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "user_cuit_not_configured": {
                    "summary": "El usuario no tiene un CUIT configurado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El usuario no tiene un CUIT configurado",
                      "instance": "/...",
                      "code": 40001009
                    }
                  },
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_revoked": {
                    "summary": "La credential asociada fue revocada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 403,
                      "detail": "La credential asociada fue revocada",
                      "instance": "/...",
                      "code": 40301008
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "platform_credential_not_configured": {
                    "summary": "No hay ninguna credential de plataforma activa configurada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 503,
                      "detail": "No hay ninguna credential de plataforma activa configurada",
                      "instance": "/...",
                      "code": 50301010
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Campos opcionales del comprobante",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/catalogs/paises": {
      "get": {
        "description": "Usado en `receptor.country_code` y `export.destination_country_code`/`export.permits[].destination_country_code` de POST /invoices (exportación/turismo).",
        "operationId": "CatalogsController_getPaises",
        "parameters": [
          {
            "name": "represented_cuit_id",
            "required": false,
            "in": "query",
            "description": "Solo para un contador o usuario en autoservicio que factura por varios clientes — elige con cuál credential consultar el catálogo. Un usuario final nunca lo manda: se resuelve solo contra su propio certificado, o contra el certificado de la plataforma si no tiene uno propio.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CatalogItemResponseDto"
                  }
                },
                "example": [
                  {
                    "id": 200,
                    "description": "ESTADOS UNIDOS",
                    "start_date": "2010-01-01",
                    "end_date": null
                  },
                  {
                    "id": 203,
                    "description": "BRASIL",
                    "start_date": "2010-01-01",
                    "end_date": null
                  }
                ]
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "user_cuit_not_configured": {
                    "summary": "El usuario no tiene un CUIT configurado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 400,
                      "detail": "El usuario no tiene un CUIT configurado",
                      "instance": "/...",
                      "code": 40001009
                    }
                  },
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  },
                  "invalid_api_client": {
                    "summary": "El Api Client es inválido o fue revocado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El Api Client es inválido o fue revocado",
                      "instance": "/...",
                      "code": 40101042
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "credential_revoked": {
                    "summary": "La credential asociada fue revocada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 403,
                      "detail": "La credential asociada fue revocada",
                      "instance": "/...",
                      "code": 40301008
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "represented_cuit_not_found": {
                    "summary": "RepresentedCuit no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "RepresentedCuit no encontrado",
                      "instance": "/...",
                      "code": 40401007
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "platform_credential_not_configured": {
                    "summary": "No hay ninguna credential de plataforma activa configurada",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 503,
                      "detail": "No hay ninguna credential de plataforma activa configurada",
                      "instance": "/...",
                      "code": 50301010
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "api-client": []
          },
          {
            "user-session": []
          }
        ],
        "summary": "Países",
        "tags": [
          "catalogs"
        ]
      }
    },
    "/api-clients": {
      "post": {
        "description": "Para integraciones server-to-server y agentes, no para uso humano interactivo. Requiere un token de sesión de usuario (no puede crearse con otro API Client). Devuelve client_id + metadata — el client_secret NO viaja acá, se pide aparte con GET /api-clients/{id}/secret.",
        "operationId": "ApiClientsController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiClientDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiClientSearchResultDto"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "500": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "api_client_operation_failed": {
                    "summary": "No se pudo completar la operación sobre el API Client — reintentá más tarde",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 500,
                      "detail": "No se pudo completar la operación sobre el API Client — reintentá más tarde",
                      "instance": "/...",
                      "code": 50001047
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "user-session": []
          }
        ],
        "summary": "Crea un API Client (credenciales OAuth 2.0 client_credentials)",
        "tags": [
          "api-clients"
        ]
      },
      "get": {
        "operationId": "ApiClientsController_search",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Número de página, arranca en 1. Default: 1.",
            "schema": {
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "size",
            "required": false,
            "in": "query",
            "description": "Cantidad de resultados por página. Default 20, máximo 100 (valores mayores se recortan a 100, nunca rechazan la request).",
            "schema": {
              "minimum": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado paginado.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/ApiClientSearchResultDto"
                          }
                        },
                        "meta": {
                          "$ref": "#/components/schemas/SearchMetaDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_error": {
                    "summary": "Campos faltantes/mal tipados (class-validator)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/bad-request",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "field must not be empty",
                      "instance": "/...",
                      "errors": [
                        "field must not be empty"
                      ]
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "user-session": []
          }
        ],
        "summary": "Lista los API Clients del usuario (nunca expone el client_secret, solo metadata + client_id)",
        "tags": [
          "api-clients"
        ]
      }
    },
    "/api-clients/{id}/secret": {
      "get": {
        "description": "A demanda, no \"se ve una sola vez\": se puede volver a pedir cuantas veces haga falta. Requiere un token de sesión de usuario (no puede pedirse con otro API Client).",
        "operationId": "ApiClientsController_getSecret",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id del API Client.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiClientSecretResponseDto"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "api_client_not_found": {
                    "summary": "Api Client no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "Api Client no encontrado",
                      "instance": "/...",
                      "code": 40401035
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "500": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "api_client_operation_failed": {
                    "summary": "No se pudo completar la operación sobre el API Client — reintentá más tarde",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 500,
                      "detail": "No se pudo completar la operación sobre el API Client — reintentá más tarde",
                      "instance": "/...",
                      "code": 50001047
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "user-session": []
          }
        ],
        "summary": "Devuelve el client_secret de un API Client propio",
        "tags": [
          "api-clients"
        ]
      }
    },
    "/api-clients/{id}": {
      "delete": {
        "operationId": "ApiClientsController_delete",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Id del API Client a revocar.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_bearer_token": {
                    "summary": "Falta el header Authorization con un Bearer token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "Falta el header Authorization con un Bearer token",
                      "instance": "/...",
                      "code": 40101037
                    }
                  },
                  "invalid_token": {
                    "summary": "El token es inválido o expiró",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "El token es inválido o expiró",
                      "instance": "/...",
                      "code": 40101038
                    }
                  },
                  "signing_key_not_found": {
                    "summary": "No se encontró la clave pública para verificar el token (kid)",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se encontró la clave pública para verificar el token (kid)",
                      "instance": "/...",
                      "code": 40101039
                    }
                  },
                  "jwks_fetch_failed": {
                    "summary": "No se pudieron obtener las claves públicas para verificar el token",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 401,
                      "detail": "No se pudieron obtener las claves públicas para verificar el token",
                      "instance": "/...",
                      "code": 40101040
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "api_client_not_found": {
                    "summary": "Api Client no encontrado",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 404,
                      "detail": "Api Client no encontrado",
                      "instance": "/...",
                      "code": 40401035
                    }
                  }
                }
              }
            },
            "description": ""
          },
          "500": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "api_client_operation_failed": {
                    "summary": "No se pudo completar la operación sobre el API Client — reintentá más tarde",
                    "value": {
                      "type": "https://errors.arca-invoicing-service.internal/api",
                      "title": "Api",
                      "status": 500,
                      "detail": "No se pudo completar la operación sobre el API Client — reintentá más tarde",
                      "instance": "/...",
                      "code": 50001047
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "user-session": []
          }
        ],
        "summary": "Revoca un API Client — deja de servir para autenticar",
        "tags": [
          "api-clients"
        ]
      }
    },
    "/health": {
      "get": {
        "operationId": "HealthController_check",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Healthcheck sin autenticación",
        "tags": [
          "health"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "user-session": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http",
        "description": "JWT de la sesión de un usuario (login OIDC en la app web). Es el único que sirve para gestionar `/api-clients`."
      },
      "api-client": {
        "scheme": "bearer",
        "bearerFormat": "API Client",
        "type": "http",
        "description": "JWT obtenido con un grant OAuth 2.0 `client_credentials` usando las credenciales de un API Client (`POST /api-clients`) — para integraciones server-to-server y agentes. Mismo header que el token de una sesión de usuario."
      }
    },
    "schemas": {
      "ApiErrorCatalogEntryDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nombre del miembro estático en `ApiError` (ej. \"INVOICE_NOT_FOUND\") — estable, es lo que hay que buscar en el código si hace falta ver dónde se tira.",
            "example": "INVOICE_NOT_FOUND"
          },
          "id": {
            "type": "number",
            "description": "Id estable del error dentro de `ApiError` — nunca se reordena/reusa.",
            "example": 15
          },
          "status": {
            "type": "number",
            "example": 404
          },
          "code": {
            "type": "number",
            "description": "`status*100_000 + apiNumber*1_000 + id`, ya resuelto contra el API_NUMBER real de este deployment — el mismo valor que aparece en el `code` de un error real.",
            "example": 40401015
          },
          "message": {
            "type": "string",
            "description": "Template crudo (`util.format`, soporta `%s`/`%d`) — sin resolver. Si no tiene ningún placeholder, `exampleDetail` es idéntico a este campo.",
            "example": "Comprobante no encontrado"
          },
          "example_params": {
            "description": "Valores de fallback para resolver `message` cuando `ErrorHelper.throw` se llama sin params explícitos.",
            "example": [],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "example_detail": {
            "type": "string",
            "description": "`message` ya resuelto con `exampleParams` — lo que un cliente vería en `detail` si este error se disparara con esos valores de ejemplo.",
            "example": "Comprobante no encontrado"
          }
        },
        "required": [
          "name",
          "id",
          "status",
          "code",
          "message",
          "example_params",
          "example_detail"
        ]
      },
      "UserResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "display_name": {
            "type": "string",
            "nullable": true
          },
          "cuit": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "tipo_persona": {
            "type": "string",
            "nullable": true
          },
          "razon_social": {
            "type": "string",
            "nullable": true
          },
          "nombre": {
            "type": "string",
            "nullable": true
          },
          "apellido": {
            "type": "string",
            "nullable": true
          },
          "domicilio_direccion": {
            "type": "string",
            "nullable": true
          },
          "domicilio_localidad": {
            "type": "string",
            "nullable": true
          },
          "domicilio_provincia": {
            "type": "string",
            "nullable": true
          },
          "domicilio_cod_postal": {
            "type": "string",
            "nullable": true
          },
          "condicion_iva_inferida_id": {
            "type": "number",
            "nullable": true
          },
          "padron_consultado_at": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "rg2904_adherent": {
            "type": "boolean",
            "nullable": true,
            "description": "Del RepresentedCuit propio (autoservicio, o el de la plataforma) — `null` si todavía no existe ninguno (nunca facturó como usuario final ni tiene su propio certificado), nunca inventado."
          }
        },
        "required": [
          "id",
          "email",
          "display_name",
          "cuit",
          "created_at",
          "tipo_persona",
          "razon_social",
          "nombre",
          "apellido",
          "domicilio_direccion",
          "domicilio_localidad",
          "domicilio_provincia",
          "domicilio_cod_postal",
          "condicion_iva_inferida_id",
          "padron_consultado_at",
          "rg2904_adherent"
        ]
      },
      "UpdateUserDto": {
        "type": "object",
        "properties": {
          "cuit": {
            "type": "string",
            "pattern": "^\\d{11}$",
            "description": "CUIT para facturar con el certificado de la plataforma (11 dígitos, sin guiones). Reenviar el mismo que ya tenía es un no-op idempotente; cambiarlo a uno distinto da 409 una vez que ya facturaste con ese CUIT."
          },
          "rg2904_adherent": {
            "type": "boolean",
            "description": "Si el usuario está adherido a RG 2904 (factura con detalle de ítem) — cambia qué datos exige ARCA en sus comprobantes locales. Se aplica al CUIT propio (autoservicio, o el de la plataforma si factura sin certificado propio), creándolo ahí mismo si todavía no existe. Omitido: no cambia el valor actual."
          }
        },
        "required": [
          "cuit"
        ]
      },
      "StandardInvoiceDetailResponseDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "STANDARD"
            ]
          },
          "concept_type": {
            "enum": [
              "PRODUCTS",
              "SERVICES",
              "PRODUCTS_AND_SERVICES"
            ],
            "type": "string"
          },
          "vat_amount": {
            "type": "number"
          },
          "service_start_date": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "service_end_date": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "payment_due_date": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "type",
          "concept_type",
          "vat_amount",
          "service_start_date",
          "service_end_date",
          "payment_due_date"
        ]
      },
      "ItemizedLineItemResponseDto": {
        "type": "object",
        "properties": {
          "measure_unit_code": {
            "type": "number"
          },
          "product_code": {
            "type": "string"
          },
          "internal_code": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "unit_of_measure_id": {
            "type": "number"
          },
          "unit_price": {
            "type": "number"
          },
          "discount_amount": {
            "type": "number"
          },
          "vat_condition_id": {
            "type": "number"
          },
          "vat_amount": {
            "type": "number"
          },
          "amount": {
            "type": "number"
          }
        },
        "required": [
          "measure_unit_code",
          "product_code",
          "internal_code",
          "description",
          "quantity",
          "unit_of_measure_id",
          "unit_price",
          "discount_amount",
          "vat_condition_id",
          "vat_amount",
          "amount"
        ]
      },
      "ItemizedInvoiceDetailResponseDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "ITEMIZED"
            ]
          },
          "concept_type": {
            "enum": [
              "PRODUCTS",
              "SERVICES",
              "PRODUCTS_AND_SERVICES"
            ],
            "type": "string"
          },
          "subtotal_amount": {
            "type": "number"
          },
          "settles_in_same_foreign_currency": {
            "type": "boolean"
          },
          "service_start_date": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "service_end_date": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "payment_due_date": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ItemizedLineItemResponseDto"
            }
          }
        },
        "required": [
          "type",
          "concept_type",
          "subtotal_amount",
          "settles_in_same_foreign_currency",
          "service_start_date",
          "service_end_date",
          "payment_due_date",
          "items"
        ]
      },
      "ExportLineItemResponseDto": {
        "type": "object",
        "properties": {
          "product_code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "unit_of_measure_id": {
            "type": "number"
          },
          "unit_price": {
            "type": "number"
          },
          "discount_amount": {
            "type": "number"
          },
          "amount": {
            "type": "number"
          }
        },
        "required": [
          "product_code",
          "description",
          "quantity",
          "unit_of_measure_id",
          "unit_price",
          "discount_amount",
          "amount"
        ]
      },
      "ExportPermitResponseDto": {
        "type": "object",
        "properties": {
          "permit_number": {
            "type": "string"
          },
          "destination_country_code": {
            "type": "number"
          }
        },
        "required": [
          "permit_number",
          "destination_country_code"
        ]
      },
      "ExportInvoiceDetailResponseDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "EXPORT"
            ]
          },
          "arca_request_id": {
            "type": "string"
          },
          "export_type": {
            "type": "number"
          },
          "has_existing_permit": {
            "type": "boolean"
          },
          "destination_country_code": {
            "type": "number"
          },
          "currency_code": {
            "type": "string"
          },
          "exchange_rate": {
            "type": "number"
          },
          "payment_method": {
            "type": "string",
            "nullable": true
          },
          "incoterms": {
            "type": "string",
            "nullable": true
          },
          "invoice_language": {
            "type": "number",
            "nullable": true
          },
          "payment_due_date": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExportLineItemResponseDto"
            }
          },
          "permits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExportPermitResponseDto"
            }
          }
        },
        "required": [
          "type",
          "arca_request_id",
          "export_type",
          "has_existing_permit",
          "destination_country_code",
          "currency_code",
          "exchange_rate",
          "payment_method",
          "incoterms",
          "invoice_language",
          "payment_due_date",
          "items",
          "permits"
        ]
      },
      "TourismLineItemResponseDto": {
        "type": "object",
        "properties": {
          "item_type": {
            "type": "number"
          },
          "tourism_code": {
            "type": "number",
            "nullable": true
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string"
          },
          "vat_rate_id": {
            "type": "number"
          },
          "vat_amount": {
            "type": "number"
          },
          "amount": {
            "type": "number"
          }
        },
        "required": [
          "item_type",
          "tourism_code",
          "code",
          "description",
          "vat_rate_id",
          "vat_amount",
          "amount"
        ]
      },
      "TourismInvoiceDetailResponseDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "TOURISM"
            ]
          },
          "authorization_type_code": {
            "type": "string"
          },
          "emitter_receiver_relation_code": {
            "type": "number"
          },
          "reimbursement_amount": {
            "type": "number"
          },
          "settles_in_same_foreign_currency": {
            "type": "boolean"
          },
          "observations": {
            "type": "string",
            "nullable": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TourismLineItemResponseDto"
            }
          }
        },
        "required": [
          "type",
          "authorization_type_code",
          "emitter_receiver_relation_code",
          "reimbursement_amount",
          "settles_in_same_foreign_currency",
          "observations",
          "items"
        ]
      },
      "InvoiceProviderErrorResponseDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Código que informó ARCA — string vacío si ARCA no devolvió uno propio para este mensaje (ej. una observación de texto libre, sin código asociado)."
          },
          "message": {
            "type": "string",
            "description": "Mensaje en términos de este DTO — nunca el texto crudo que manda ARCA (que puede nombrar sus propios campos internos). Para códigos sin un mensaje curado, un texto genérico según `type`."
          },
          "type": {
            "enum": [
              "error",
              "observation"
            ],
            "type": "string",
            "description": "`error` si ARCA lo consideró bloqueante (participa de un comprobante REJECTED), `observation` si es solo informativo."
          }
        },
        "required": [
          "code",
          "message",
          "type"
        ]
      },
      "VoucherResponseDto": {
        "type": "object",
        "properties": {
          "letter": {
            "enum": [
              "A",
              "B",
              "C",
              "M",
              "E",
              "T"
            ],
            "type": "string"
          },
          "kind": {
            "enum": [
              "FACTURA",
              "NOTA_DEBITO",
              "NOTA_CREDITO"
            ],
            "type": "string"
          },
          "sales_point_number": {
            "type": "number"
          },
          "number": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "letter",
          "kind",
          "sales_point_number",
          "number"
        ]
      },
      "AuthorizationResponseDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "code",
          "expires_at"
        ]
      },
      "CatalogLabelResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "label": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "label"
        ]
      },
      "IdentificationResponseDto": {
        "type": "object",
        "properties": {
          "category": {
            "enum": [
              "NATIONAL_DOCUMENT",
              "FOREIGN_TAX_ID"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "document_type": {
            "nullable": true,
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/CatalogLabelResponseDto"
              }
            ]
          }
        },
        "required": [
          "category",
          "value",
          "document_type"
        ]
      },
      "InvoiceReceptorResponseDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "identification": {
            "$ref": "#/components/schemas/IdentificationResponseDto"
          },
          "tax_condition": {
            "nullable": true,
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/CatalogLabelResponseDto"
              }
            ]
          },
          "country_code": {
            "type": "number",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "name",
          "identification",
          "tax_condition",
          "country_code",
          "address"
        ]
      },
      "InvoiceLineItemResponseDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "unit_of_measure_id": {
            "type": "number"
          },
          "unit_price": {
            "type": "number"
          },
          "discount_amount": {
            "type": "number"
          },
          "amount": {
            "type": "number"
          }
        },
        "required": [
          "description",
          "quantity",
          "unit_of_measure_id",
          "unit_price",
          "discount_amount",
          "amount"
        ]
      },
      "InvoiceVatItemResponseDto": {
        "type": "object",
        "properties": {
          "vat_rate_id": {
            "type": "number"
          },
          "taxable_base": {
            "type": "number"
          },
          "amount": {
            "type": "number"
          }
        },
        "required": [
          "vat_rate_id",
          "taxable_base",
          "amount"
        ]
      },
      "InvoiceTaxItemResponseDto": {
        "type": "object",
        "properties": {
          "tax_type_id": {
            "type": "number"
          },
          "description": {
            "type": "string"
          },
          "taxable_base": {
            "type": "number"
          },
          "rate": {
            "type": "number"
          },
          "amount": {
            "type": "number"
          }
        },
        "required": [
          "tax_type_id",
          "description",
          "taxable_base",
          "rate",
          "amount"
        ]
      },
      "InvoiceAssociationResponseDto": {
        "type": "object",
        "properties": {
          "related_voucher_type": {
            "type": "number"
          },
          "related_sales_point_number": {
            "type": "number"
          },
          "related_voucher_number": {
            "type": "number"
          },
          "related_cuit": {
            "type": "string"
          },
          "related_issue_date": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "related_voucher_type",
          "related_sales_point_number",
          "related_voucher_number",
          "related_cuit",
          "related_issue_date"
        ]
      },
      "AmountsResponseDto": {
        "type": "object",
        "properties": {
          "taxable": {
            "type": "number"
          },
          "non_taxable": {
            "type": "number"
          },
          "exempt": {
            "type": "number"
          },
          "other_taxes": {
            "type": "number"
          },
          "currency_code": {
            "type": "string"
          },
          "exchange_rate": {
            "type": "number"
          }
        },
        "required": [
          "taxable",
          "non_taxable",
          "exempt",
          "other_taxes",
          "currency_code",
          "exchange_rate"
        ]
      },
      "InvoiceResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "represented_cuit_id": {
            "type": "string"
          },
          "created_by_user_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "PENDING",
              "APPROVED",
              "REJECTED",
              "OBSERVED"
            ],
            "type": "string"
          },
          "provider_errors": {
            "description": "Errores/observaciones que devolvió ARCA, ya normalizados a un shape único — vacío si no hubo ninguno (comprobante APPROVED sin observaciones).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceProviderErrorResponseDto"
            }
          },
          "voucher": {
            "$ref": "#/components/schemas/VoucherResponseDto"
          },
          "issue_date": {
            "format": "date-time",
            "type": "string"
          },
          "total_amount": {
            "type": "number"
          },
          "authorization": {
            "nullable": true,
            "description": "`null` mientras no hay CAE (PENDING/REJECTED).",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/AuthorizationResponseDto"
              }
            ]
          },
          "receptor": {
            "$ref": "#/components/schemas/InvoiceReceptorResponseDto"
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineItemResponseDto"
            }
          },
          "vat_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceVatItemResponseDto"
            }
          },
          "tax_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceTaxItemResponseDto"
            }
          },
          "associations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceAssociationResponseDto"
            }
          },
          "amounts": {
            "nullable": true,
            "description": "`null` únicamente en exportación (`detail.type === \"EXPORT\"`).",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/AmountsResponseDto"
              }
            ]
          },
          "detail": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/StandardInvoiceDetailResponseDto"
              },
              {
                "$ref": "#/components/schemas/ItemizedInvoiceDetailResponseDto"
              },
              {
                "$ref": "#/components/schemas/ExportInvoiceDetailResponseDto"
              },
              {
                "$ref": "#/components/schemas/TourismInvoiceDetailResponseDto"
              }
            ],
            "discriminator": {
              "propertyName": "type",
              "mapping": {
                "STANDARD": "#/components/schemas/StandardInvoiceDetailResponseDto",
                "ITEMIZED": "#/components/schemas/ItemizedInvoiceDetailResponseDto",
                "EXPORT": "#/components/schemas/ExportInvoiceDetailResponseDto",
                "TOURISM": "#/components/schemas/TourismInvoiceDetailResponseDto"
              }
            }
          }
        },
        "required": [
          "id",
          "represented_cuit_id",
          "created_by_user_id",
          "created_at",
          "status",
          "provider_errors",
          "voucher",
          "issue_date",
          "total_amount",
          "authorization",
          "receptor",
          "line_items",
          "vat_items",
          "tax_items",
          "associations",
          "amounts",
          "detail"
        ]
      },
      "SearchMetaDto": {
        "type": "object",
        "properties": {
          "current_page": {
            "type": "number",
            "description": "Página actual (1-indexada).",
            "example": 1
          },
          "total_pages": {
            "type": "number",
            "description": "Cantidad total de páginas.",
            "example": 3
          },
          "page_size": {
            "type": "number",
            "description": "Cantidad de resultados por página.",
            "example": 20
          },
          "total_elements": {
            "type": "number",
            "description": "Cantidad total de resultados.",
            "example": 42
          }
        },
        "required": [
          "current_page",
          "total_pages",
          "page_size",
          "total_elements"
        ]
      },
      "InvoiceSearchResultDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "voucher": {
            "$ref": "#/components/schemas/VoucherResponseDto"
          },
          "issue_date": {
            "format": "date-time",
            "type": "string"
          },
          "total_amount": {
            "type": "number"
          },
          "status": {
            "enum": [
              "PENDING",
              "APPROVED",
              "REJECTED",
              "OBSERVED"
            ],
            "type": "string"
          },
          "authorization": {
            "nullable": true,
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/AuthorizationResponseDto"
              }
            ]
          }
        },
        "required": [
          "id",
          "voucher",
          "issue_date",
          "total_amount",
          "status",
          "authorization"
        ]
      },
      "InvoiceReceptorDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Solo se usa en exportación; en el resto de los casos se completa desde el padrón (GET /padron/:cuit) si corresponde."
          },
          "identification_category": {
            "enum": [
              "NATIONAL_DOCUMENT",
              "FOREIGN_TAX_ID"
            ],
            "type": "string",
            "description": "NATIONAL_DOCUMENT: identificado por CUIT/CUIL/CDI/DNI (`documentType` obligatorio, ver GET /catalogs). FOREIGN_TAX_ID: identificación impositiva de un cliente del exterior (exportación/turismo) — sin `documentType`."
          },
          "document_type": {
            "type": "number",
            "description": "Código de tipo de documento (ver GET /catalogs/tipos-documento-receptor) — obligatorio solo si identificationCategory es NATIONAL_DOCUMENT."
          },
          "identification_value": {
            "type": "string",
            "description": "CUIT/CUIL/CDI/DNI si identificationCategory es NATIONAL_DOCUMENT, o la identificación impositiva del cliente del exterior si es FOREIGN_TAX_ID."
          },
          "tax_condition_id": {
            "type": "number",
            "description": "Condición frente al IVA (ver GET /catalogs/tipos-responsable) — obligatoria desde RG 5616 para facturas locales."
          },
          "country_code": {
            "type": "number",
            "description": "Código de país — solo en exportación/turismo."
          },
          "address": {
            "type": "string",
            "description": "Domicilio del receptor — solo en exportación/turismo."
          }
        },
        "required": [
          "identification_category",
          "identification_value"
        ]
      },
      "InvoiceAssociationDto": {
        "type": "object",
        "properties": {
          "related_voucher_type": {
            "type": "number",
            "description": "Código de comprobante del original (ver GET /catalogs/tipos-comprobante)."
          },
          "related_sales_point_number": {
            "type": "number",
            "description": "Punto de venta del comprobante original."
          },
          "related_voucher_number": {
            "type": "number",
            "description": "Número del comprobante original."
          },
          "related_cuit": {
            "type": "string",
            "description": "CUIT del emisor del comprobante original — si se omite, se usa el propio."
          }
        },
        "required": [
          "related_voucher_type",
          "related_sales_point_number",
          "related_voucher_number"
        ]
      },
      "InvoiceLineItemDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Qué se vendió."
          },
          "quantity": {
            "type": "number",
            "minimum": 0,
            "description": "Puede ser fraccionaria (ej. kg, horas)."
          },
          "unit_of_measure_id": {
            "type": "number",
            "description": "Código de GET /catalogs/unidad-medida."
          },
          "unit_price": {
            "type": "number",
            "minimum": 0,
            "description": "Precio unitario, en centavos."
          },
          "discount_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Descuento de este renglón, en centavos."
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "description": "Subtotal del renglón, en centavos, ya con el descuento aplicado."
          }
        },
        "required": [
          "description",
          "quantity",
          "unit_of_measure_id",
          "unit_price",
          "amount"
        ]
      },
      "InvoiceVatItemDto": {
        "type": "object",
        "properties": {
          "vat_rate_id": {
            "type": "number",
            "description": "Código de alícuota (ver GET /catalogs/alicuotas-iva)."
          },
          "taxable_base": {
            "type": "number",
            "minimum": 0,
            "description": "Base imponible de esta alícuota, en centavos."
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "description": "IVA de esta alícuota, en centavos."
          }
        },
        "required": [
          "vat_rate_id",
          "taxable_base",
          "amount"
        ]
      },
      "InvoiceTaxItemDto": {
        "type": "object",
        "properties": {
          "tax_type_id": {
            "type": "number",
            "description": "Código de tributo (ver GET /catalogs/tipos-tributo)."
          },
          "description": {
            "type": "string",
            "description": "Descripción del tributo."
          },
          "taxable_base": {
            "type": "number",
            "minimum": 0,
            "description": "Base imponible de este tributo, en centavos."
          },
          "rate": {
            "type": "number",
            "description": "Porcentaje (ej. 1 = 1%), no centavos."
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "description": "Monto de este tributo, en centavos."
          }
        },
        "required": [
          "tax_type_id",
          "description",
          "taxable_base",
          "rate",
          "amount"
        ]
      },
      "ExportLineItemDto": {
        "type": "object",
        "properties": {
          "product_code": {
            "type": "string",
            "description": "Código propio del producto exportado."
          },
          "description": {
            "type": "string",
            "description": "Qué se exportó."
          },
          "quantity": {
            "type": "number",
            "minimum": 0,
            "description": "Puede ser fraccionaria (ej. kg, toneladas)."
          },
          "unit_of_measure_id": {
            "type": "number",
            "description": "Código de GET /catalogs/unidad-medida."
          },
          "unit_price": {
            "type": "number",
            "minimum": 0,
            "description": "Precio unitario, en centavos."
          },
          "discount_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Descuento de este renglón, en centavos."
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "description": "Subtotal del renglón, en centavos."
          }
        },
        "required": [
          "product_code",
          "description",
          "quantity",
          "unit_of_measure_id",
          "unit_price",
          "amount"
        ]
      },
      "ExportPermitDto": {
        "type": "object",
        "properties": {
          "permit_number": {
            "type": "string",
            "description": "Número de permiso de embarque."
          },
          "destination_country_code": {
            "type": "number",
            "description": "País destino de este permiso (ver GET /catalogs/paises)."
          }
        },
        "required": [
          "permit_number",
          "destination_country_code"
        ]
      },
      "ExportInvoiceFieldsDto": {
        "type": "object",
        "properties": {
          "export_type": {
            "type": "number",
            "enum": [
              1,
              2,
              4
            ],
            "description": "1 Bienes / 2 Servicios / 4 Otros — solo 1 (Bienes) exige que el emisor esté registrado como exportador ante ARCA (error 1668 si no lo está)."
          },
          "has_existing_permit": {
            "type": "boolean",
            "description": "Si ya existe un permiso de embarque para este envío."
          },
          "destination_country_code": {
            "type": "number",
            "description": "País destino (ver GET /catalogs/paises)."
          },
          "currency_code": {
            "type": "string",
            "description": "Código de moneda de la operación."
          },
          "exchange_rate": {
            "type": "number",
            "description": "Cotización de `currencyCode` contra pesos."
          },
          "payment_method": {
            "type": "string",
            "description": "Forma de pago acordada."
          },
          "incoterms": {
            "type": "string",
            "description": "Incoterm de la operación (ej. FOB, CIF)."
          },
          "invoice_language": {
            "type": "number",
            "description": "Idioma del comprobante (ver GET /catalogs/idiomas) — default 1 (Español) si se omite."
          },
          "payment_due_date": {
            "type": "string",
            "description": "Fecha límite de pago — obligatorio si exportType es 2 o 4."
          },
          "items": {
            "minItems": 1,
            "description": "Renglones exportados.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExportLineItemDto"
            }
          },
          "permits": {
            "minItems": 1,
            "description": "Permisos de embarque, si hasExistingPermit es true.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExportPermitDto"
            }
          }
        },
        "required": [
          "export_type",
          "has_existing_permit",
          "destination_country_code",
          "currency_code",
          "exchange_rate",
          "items"
        ]
      },
      "TourismLineItemDto": {
        "type": "object",
        "properties": {
          "item_type": {
            "type": "number",
            "description": "Tipo de ítem."
          },
          "tourism_code": {
            "type": "number",
            "enum": [
              1,
              2,
              5
            ],
            "description": "1 hotelería sin desayuno / 2 con desayuno / 5 excedente — un comprobante no puede tener únicamente ítems con código 5 (400 si se intenta)."
          },
          "code": {
            "type": "string",
            "description": "Código propio del ítem."
          },
          "description": {
            "type": "string",
            "description": "Qué se vendió."
          },
          "vat_rate_id": {
            "type": "number",
            "description": "Código de alícuota (ver GET /catalogs/alicuotas-iva)."
          },
          "vat_amount": {
            "type": "number",
            "minimum": 0,
            "description": "IVA de este renglón, en centavos."
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "description": "Subtotal del renglón, en centavos."
          }
        },
        "required": [
          "item_type",
          "description",
          "vat_rate_id",
          "vat_amount",
          "amount"
        ]
      },
      "TourismInvoiceFieldsDto": {
        "type": "object",
        "properties": {
          "emitter_receiver_relation_code": {
            "type": "number",
            "enum": [
              1,
              2,
              3,
              4,
              5,
              6
            ],
            "description": "Relación entre emisor y receptor: 1 Alojamiento directo a turista no residente / 2 Alojamiento a agencia de viaje residente / 3 Alojamiento a agencia de viaje no residente / 4 Agencia de viaje residente a agencia de viaje no residente / 5 Agencia de viaje residente a turista no residente / 6 Agencia de viaje residente a agencia de viaje residente."
          },
          "taxable_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Monto gravado, en centavos."
          },
          "non_taxable_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Monto no gravado, en centavos."
          },
          "exempt_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Monto exento, en centavos."
          },
          "other_taxes_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Otros tributos, en centavos."
          },
          "reimbursement_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Reintegro de IVA a turistas, en centavos — obligatorio si algún ítem tiene tourismCode 1 o 2."
          },
          "currency_code": {
            "type": "string",
            "description": "Código de moneda de la operación."
          },
          "exchange_rate": {
            "type": "number",
            "description": "Cotización de `currencyCode` contra pesos."
          },
          "settles_in_same_foreign_currency": {
            "type": "boolean",
            "description": "Si la cancelación se hace en la misma moneda extranjera."
          },
          "observations": {
            "type": "string",
            "description": "Observaciones libres del comprobante."
          },
          "items": {
            "minItems": 1,
            "description": "Renglones del comprobante — al menos uno con tourismCode distinto de 5.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TourismLineItemDto"
            }
          }
        },
        "required": [
          "emitter_receiver_relation_code",
          "taxable_amount",
          "non_taxable_amount",
          "exempt_amount",
          "other_taxes_amount",
          "reimbursement_amount",
          "currency_code",
          "exchange_rate",
          "settles_in_same_foreign_currency",
          "items"
        ]
      },
      "CreateInvoiceDto": {
        "type": "object",
        "properties": {
          "represented_cuit_id": {
            "type": "string",
            "description": "Solo para un contador o usuario en autoservicio que factura por varios clientes — elige a cuál. Un usuario final nunca lo manda: se resuelve solo contra su propio certificado, o contra el certificado de la plataforma si no tiene uno propio."
          },
          "letter": {
            "enum": [
              "A",
              "B",
              "C",
              "M",
              "E",
              "T"
            ],
            "type": "string",
            "description": "Letra del comprobante. A/B/C/M son facturas locales; E es exportación (requiere `export`); T es turismo (requiere `tourism`)."
          },
          "kind": {
            "enum": [
              "FACTURA",
              "NOTA_DEBITO",
              "NOTA_CREDITO"
            ],
            "type": "string",
            "description": "FACTURA, NOTA_DEBITO o NOTA_CREDITO. Una nota de crédito/débito requiere `associations` apuntando al comprobante original (excepto en turismo)."
          },
          "sales_point_number": {
            "type": "number",
            "description": "Punto de venta habilitado en ARCA para el CUIT que emite."
          },
          "issue_date": {
            "type": "string",
            "description": "Fecha de emisión (yyyy-mm-dd). Tiene que estar dentro de la ventana que ARCA exige respecto de hoy (400 si no)."
          },
          "total_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Total del comprobante, en centavos (ej. 12100 = $121,00)."
          },
          "receptor": {
            "description": "A quién se le emite el comprobante.",
            "allOf": [
              {
                "$ref": "#/components/schemas/InvoiceReceptorDto"
              }
            ]
          },
          "associations": {
            "minItems": 1,
            "description": "Comprobante(s) original(es) que esta nota ajusta — obligatorio para kind=NOTA_DEBITO/NOTA_CREDITO, salvo en turismo.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceAssociationDto"
            }
          },
          "concept_type": {
            "enum": [
              "PRODUCTS",
              "SERVICES",
              "PRODUCTS_AND_SERVICES"
            ],
            "type": "string",
            "description": "PRODUCTS/SERVICES/PRODUCTS_AND_SERVICES. Requerido para facturas locales (letter A/B/C/M). SERVICES/PRODUCTS_AND_SERVICES exigen serviceStartDate/serviceEndDate."
          },
          "taxable_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Monto gravado, en centavos. Requerido para facturas locales (letter A/B/C/M)."
          },
          "non_taxable_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Monto no gravado, en centavos. Requerido para facturas locales."
          },
          "exempt_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Monto exento, en centavos. Requerido para facturas locales."
          },
          "vat_amount": {
            "type": "number",
            "minimum": 0,
            "description": "IVA total, en centavos — debe coincidir con la suma de `vatItems`. Requerido para facturas locales."
          },
          "other_taxes_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Otros tributos, en centavos — debe coincidir con la suma de `taxItems`. Requerido para facturas locales."
          },
          "currency_code": {
            "type": "string",
            "description": "Código de moneda (ver GET /catalogs/monedas) — PES para pesos. Requerido para facturas locales."
          },
          "exchange_rate": {
            "type": "number",
            "description": "Cotización de `currencyCode` contra pesos — 1 si `currencyCode` es PES. Requerido para facturas locales."
          },
          "service_start_date": {
            "type": "string",
            "description": "Fecha de inicio del servicio facturado. Requerido junto con serviceEndDate y paymentDueDate si conceptType es SERVICES o PRODUCTS_AND_SERVICES."
          },
          "service_end_date": {
            "type": "string",
            "description": "Fecha de fin del servicio facturado — ver serviceStartDate."
          },
          "payment_due_date": {
            "type": "string",
            "description": "Fecha límite de pago — ver serviceStartDate."
          },
          "items": {
            "minItems": 1,
            "description": "Renglones de detalle (qué se vendió). Opcionales en el circuito estándar (solo se usan para el PDF); obligatorios y fiscalmente validados en el circuito itemizado (RG 2904).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineItemDto"
            }
          },
          "vat_items": {
            "minItems": 1,
            "description": "Desglose de IVA por alícuota. Requerido para facturas locales — la suma debe coincidir con `vatAmount`.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceVatItemDto"
            }
          },
          "tax_items": {
            "minItems": 1,
            "description": "Otros tributos (además del IVA) — la suma debe coincidir con `otherTaxesAmount`.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceTaxItemDto"
            }
          },
          "export": {
            "description": "Campos propios de una factura de exportación. Obligatorio si letter=E, ignorado en cualquier otro caso.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ExportInvoiceFieldsDto"
              }
            ]
          },
          "tourism": {
            "description": "Campos propios de una factura de turismo. Obligatorio si letter=T, ignorado en cualquier otro caso.",
            "allOf": [
              {
                "$ref": "#/components/schemas/TourismInvoiceFieldsDto"
              }
            ]
          }
        },
        "required": [
          "letter",
          "kind",
          "sales_point_number",
          "issue_date",
          "total_amount",
          "receptor"
        ]
      },
      "VerifyVoucherObservationDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "number"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "VerifyVoucherResponseDto": {
        "type": "object",
        "properties": {
          "result": {
            "type": "string",
            "description": "'A' Autorizado / 'R' Rechazado / 'N' No encontrado — tal cual lo informa ARCA."
          },
          "observations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VerifyVoucherObservationDto"
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VerifyVoucherObservationDto"
            }
          }
        },
        "required": [
          "result",
          "observations",
          "errors"
        ]
      },
      "CredentialSearchResultDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "cuit": {
            "type": "string"
          },
          "status": {
            "enum": [
              "PENDING_CERT",
              "ACTIVE",
              "REVOKED"
            ],
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "revoked_at": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "cuit",
          "status",
          "expires_at",
          "revoked_at"
        ]
      },
      "CsrResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "cuit": {
            "type": "string"
          },
          "csr_pem": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING_CERT"
            ]
          }
        },
        "required": [
          "id",
          "cuit",
          "csr_pem",
          "status"
        ]
      },
      "UploadCertificateDto": {
        "type": "object",
        "properties": {
          "cert_pem": {
            "type": "string",
            "description": "El .crt que devuelve AFIP al procesar el CSR de POST /credentials/csr."
          }
        },
        "required": [
          "cert_pem"
        ]
      },
      "CredentialResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "owner_user_id": {
            "type": "string",
            "nullable": true,
            "description": "Null solo sería una credential de la plataforma — esa nunca se expone acá (no existe ningún endpoint HTTP que la devuelva), este campo es siempre string en la práctica."
          },
          "cuit": {
            "type": "string"
          },
          "status": {
            "enum": [
              "PENDING_CERT",
              "ACTIVE",
              "REVOKED"
            ],
            "type": "string"
          },
          "csr_pem": {
            "type": "string",
            "nullable": true,
            "description": "Solo presente mientras status=PENDING_CERT — para volver a pegarlo en AFIP si se perdió."
          },
          "expires_at": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "revoked_at": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "owner_user_id",
          "cuit",
          "status",
          "csr_pem",
          "expires_at",
          "revoked_at",
          "created_at"
        ]
      },
      "RepresentedCuitSearchResultDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "cuit": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "nullable": true
          },
          "is_self": {
            "type": "boolean"
          },
          "rg2904_adherent": {
            "type": "boolean"
          },
          "default_sales_point_number": {
            "type": "number",
            "nullable": true,
            "description": "Punto de venta a preseleccionar en \"Emitir factura\" para este CUIT — pura conveniencia de UI, `null` si nunca se configuró."
          },
          "tipo_persona": {
            "type": "string",
            "nullable": true
          },
          "razon_social": {
            "type": "string",
            "nullable": true
          },
          "nombre": {
            "type": "string",
            "nullable": true
          },
          "apellido": {
            "type": "string",
            "nullable": true
          },
          "domicilio_direccion": {
            "type": "string",
            "nullable": true
          },
          "domicilio_localidad": {
            "type": "string",
            "nullable": true
          },
          "domicilio_provincia": {
            "type": "string",
            "nullable": true
          },
          "domicilio_cod_postal": {
            "type": "string",
            "nullable": true
          },
          "condicion_iva_inferida_id": {
            "type": "number",
            "nullable": true
          },
          "padron_consultado_at": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "cuit",
          "label",
          "is_self",
          "rg2904_adherent",
          "default_sales_point_number",
          "tipo_persona",
          "razon_social",
          "nombre",
          "apellido",
          "domicilio_direccion",
          "domicilio_localidad",
          "domicilio_provincia",
          "domicilio_cod_postal",
          "condicion_iva_inferida_id",
          "padron_consultado_at"
        ]
      },
      "CreateRepresentedCuitDto": {
        "type": "object",
        "properties": {
          "credential_id": {
            "type": "string",
            "description": "Credential bajo la cual se registra este CUIT delegado."
          },
          "cuit": {
            "type": "string",
            "pattern": "^\\d{11}$",
            "description": "CUIT del cliente delegado (modo contador) — 11 dígitos, sin guiones."
          },
          "label": {
            "type": "string",
            "description": "Etiqueta descriptiva opcional (ej. nombre del cliente)."
          },
          "rg2904_adherent": {
            "type": "boolean",
            "description": "Si este CUIT está adherido a RG 2904 (factura con detalle de ítem) — dato que ARCA no informa por ninguna vía consultable, se declara acá. Corregible después vía PATCH /represented-cuits/{id}."
          }
        },
        "required": [
          "credential_id",
          "cuit"
        ]
      },
      "RepresentedCuitResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "credential_id": {
            "type": "string"
          },
          "cuit": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "nullable": true
          },
          "is_self": {
            "type": "boolean"
          },
          "rg2904_adherent": {
            "type": "boolean"
          },
          "default_sales_point_number": {
            "type": "number",
            "nullable": true,
            "description": "Punto de venta a preseleccionar en \"Emitir factura\" para este CUIT — pura conveniencia de UI, `null` si nunca se configuró."
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "tipo_persona": {
            "type": "string",
            "nullable": true
          },
          "razon_social": {
            "type": "string",
            "nullable": true
          },
          "nombre": {
            "type": "string",
            "nullable": true
          },
          "apellido": {
            "type": "string",
            "nullable": true
          },
          "domicilio_direccion": {
            "type": "string",
            "nullable": true
          },
          "domicilio_localidad": {
            "type": "string",
            "nullable": true
          },
          "domicilio_provincia": {
            "type": "string",
            "nullable": true
          },
          "domicilio_cod_postal": {
            "type": "string",
            "nullable": true
          },
          "condicion_iva_inferida_id": {
            "type": "number",
            "nullable": true
          },
          "padron_consultado_at": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "credential_id",
          "cuit",
          "label",
          "is_self",
          "rg2904_adherent",
          "default_sales_point_number",
          "created_at",
          "tipo_persona",
          "razon_social",
          "nombre",
          "apellido",
          "domicilio_direccion",
          "domicilio_localidad",
          "domicilio_provincia",
          "domicilio_cod_postal",
          "condicion_iva_inferida_id",
          "padron_consultado_at"
        ]
      },
      "UpdateRepresentedCuitDto": {
        "type": "object",
        "properties": {
          "rg2904_adherent": {
            "type": "boolean",
            "description": "Si este CUIT está adherido a RG 2904 (factura con detalle de ítem). Cambiarlo solo afecta comprobantes emitidos DESPUÉS de este PATCH — los ya emitidos no se re-emiten ni cambian de circuito."
          },
          "default_sales_point_number": {
            "type": "number",
            "nullable": true,
            "minimum": 1,
            "description": "Punto de venta a preseleccionar en \"Emitir factura\" para este CUIT — null para quitarlo. No se valida contra ARCA al setearlo."
          }
        }
      },
      "CreateCbuInformadaSalesPointDto": {
        "type": "object",
        "properties": {
          "sales_point_number": {
            "type": "number",
            "minimum": 1,
            "description": "Punto de venta ya dado de alta en ARCA para esta modalidad (ver GET /catalogs/puntos-venta para los puntos de venta habilitados en general)."
          },
          "cbu": {
            "type": "string",
            "description": "CBU a imprimir en el PDF junto a la leyenda — opcional, recomendado por ARCA para facilitarle el pago al receptor. Sin esto, igual se imprime la leyenda, sin el número de cuenta."
          }
        },
        "required": [
          "sales_point_number"
        ]
      },
      "CbuInformadaSalesPointResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sales_point_number": {
            "type": "number"
          },
          "cbu": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "sales_point_number",
          "cbu",
          "created_at"
        ]
      },
      "UpdateCbuInformadaSalesPointDto": {
        "type": "object",
        "properties": {
          "cbu": {
            "type": "string",
            "nullable": true,
            "description": "CBU nuevo, o null para quitarlo (la leyenda se sigue imprimiendo igual, sin el número de cuenta)."
          }
        },
        "required": [
          "cbu"
        ]
      },
      "VerifyVoucherDto": {
        "type": "object",
        "properties": {
          "represented_cuit_id": {
            "type": "string",
            "description": "Con cuya credential se autentica la consulta — no tiene por qué ser el emisor del comprobante que se está constatando (ver issuerCuit). Un usuario final nunca lo manda: se resuelve solo contra su propio certificado, o contra el de la plataforma si no tiene uno propio."
          },
          "issuer_cuit": {
            "type": "string",
            "description": "CUIT del emisor del comprobante a constatar — no tiene por qué coincidir con representedCuitId."
          },
          "sales_point_number": {
            "type": "number",
            "description": "Punto de venta del comprobante a constatar."
          },
          "voucher_type": {
            "type": "number",
            "description": "Código de comprobante de ARCA (ver GET /catalogs/tipos-comprobante)."
          },
          "voucher_number": {
            "type": "number",
            "description": "Número del comprobante a constatar."
          },
          "issue_date": {
            "type": "string",
            "description": "Fecha de emisión del comprobante (yyyy-mm-dd)."
          },
          "total_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Total del comprobante, en centavos."
          },
          "authorization_code": {
            "type": "string",
            "description": "CAE/CAI/CAEA del comprobante a constatar."
          },
          "receptor_document_type": {
            "type": "number",
            "description": "Tipo de documento del receptor (ver GET /catalogs/tipos-documento-receptor) — ARCA lo exige según el tipo de comprobante y su importe."
          },
          "receptor_document_value": {
            "type": "string",
            "description": "Identificación del receptor — ver receptorDocumentType."
          }
        },
        "required": [
          "issuer_cuit",
          "sales_point_number",
          "voucher_type",
          "voucher_number",
          "issue_date",
          "total_amount",
          "authorization_code"
        ]
      },
      "ContribuyenteResponseDto": {
        "type": "object",
        "properties": {
          "cuit": {
            "type": "string"
          },
          "tipo_persona": {
            "type": "string",
            "nullable": true
          },
          "razon_social": {
            "type": "string",
            "nullable": true
          },
          "nombre": {
            "type": "string",
            "nullable": true
          },
          "apellido": {
            "type": "string",
            "nullable": true
          },
          "domicilio_direccion": {
            "type": "string",
            "nullable": true
          },
          "domicilio_localidad": {
            "type": "string",
            "nullable": true
          },
          "domicilio_provincia": {
            "type": "string",
            "nullable": true
          },
          "domicilio_cod_postal": {
            "type": "string",
            "nullable": true
          },
          "condicion_iva_inferida_id": {
            "type": "number",
            "nullable": true,
            "description": "Condición frente al IVA inferida a partir de los datos del padrón — no es autoritativa. Mismo código que GET /catalogs/tipos-responsable."
          },
          "consultado_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "cuit",
          "tipo_persona",
          "razon_social",
          "nombre",
          "apellido",
          "domicilio_direccion",
          "domicilio_localidad",
          "domicilio_provincia",
          "domicilio_cod_postal",
          "condicion_iva_inferida_id",
          "consultado_at"
        ]
      },
      "StaticCatalogItemResponseDto": {
        "type": "object",
        "properties": {
          "codigo": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ]
          },
          "descripcion": {
            "type": "string"
          },
          "observaciones": {
            "type": "string",
            "nullable": true,
            "description": "Solo en `operacion-condicion-iva`: aclaración de ARCA sobre el código (ej. que no aplica para factura electrónica)."
          }
        },
        "required": [
          "codigo",
          "descripcion"
        ]
      },
      "CuitPaisResponseDto": {
        "type": "object",
        "properties": {
          "cuit_pais": {
            "type": "string",
            "description": "CUIT genérico que ARCA asigna a este país para clientes del exterior."
          },
          "descripcion": {
            "type": "string"
          },
          "codigo_tipo_sujeto": {
            "type": "number"
          }
        },
        "required": [
          "cuit_pais",
          "descripcion",
          "codigo_tipo_sujeto"
        ]
      },
      "CatalogItemResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ]
          },
          "description": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "nullable": true,
            "format": "date"
          },
          "end_date": {
            "type": "string",
            "nullable": true,
            "format": "date"
          }
        },
        "required": [
          "id",
          "description",
          "start_date",
          "end_date"
        ]
      },
      "SalesPointResponseDto": {
        "type": "object",
        "properties": {
          "number": {
            "type": "number"
          },
          "emission_type": {
            "type": "string"
          },
          "blocked": {
            "type": "boolean"
          },
          "deactivated_at": {
            "type": "string",
            "nullable": true,
            "format": "date"
          }
        },
        "required": [
          "number",
          "emission_type",
          "blocked",
          "deactivated_at"
        ]
      },
      "CreateApiClientDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "maxLength": 120,
            "description": "Nombre descriptivo para identificar este API Client (ej. \"CI/CD\", \"Zapier\")."
          }
        },
        "required": [
          "label"
        ]
      },
      "ApiClientSearchResultDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "description": "Nombre descriptivo cargado al crear este API Client."
          },
          "client_id": {
            "type": "string",
            "description": "client_id OAuth 2.0 — se usa para el grant client_credentials."
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_used_at": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "revoked_at": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "label",
          "client_id",
          "created_at",
          "last_used_at",
          "revoked_at"
        ]
      },
      "ApiClientSecretResponseDto": {
        "type": "object",
        "properties": {
          "client_secret": {
            "type": "string",
            "description": "Secreto en texto plano — junto con clientId, para el client_credentials grant."
          }
        },
        "required": [
          "client_secret"
        ]
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "Facturación",
      "tags": [
        "invoices",
        "voucher-verification"
      ]
    },
    {
      "name": "Configuración de la cuenta",
      "tags": [
        "users",
        "credentials",
        "represented-cuits"
      ]
    },
    {
      "name": "Datos de referencia",
      "tags": [
        "catalogs",
        "padron",
        "errors"
      ]
    },
    {
      "name": "Acceso programático",
      "tags": [
        "api-clients"
      ]
    },
    {
      "name": "Operación",
      "tags": [
        "health"
      ]
    }
  ]
}