{"openapi":"3.0.0","info":{"title":"API Recepción HKA DEMO","version":"1.0.0","description":"Servicios de recepción de documentos electrónicos HKA"},"servers":[{"url":"https://demoapirecepcion.thefactoryhka.com.pa/ApiRest/Service.svc"}],"paths":{"/Autenticacion":{"post":{"tags":["Autenticación"],"summary":"Autenticación","description":"Envía credenciales para obtener el token de acceso.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"RUC":{"type":"string","example":"155555-5-5555"},"Usuario":{"type":"string","example":"belkvbbvexoe_tfhka"},"Clave":{"type":"string","example":"x,jxx;KP_FI?"},"TipoAplicacion":{"type":"string","example":"ws"}}}}}},"responses":{"200":{"description":"OK - Credenciales correctas","content":{"application/json":{"schema":{"type":"object","properties":{"Codigo":{"type":"string","example":"200"},"FechaExpiracion":{"type":"string","example":"2026-06-03 15:03:47"},"Mensaje":{"type":"string","example":"Credenciales correctas, se genera token."},"Token":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}}}}}}}}},"/ConsultarEstadoDocumento":{"post":{"tags":["Consultar Estado Documento"],"summary":"Consultar estado de documento","description":"Consulta el estatus fiscal y personalizado de un documento enviado mediante su CUFE/Código.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["Documento","RUC","Token"],"properties":{"Documento":{"type":"string","example":"FE0120000000155555-5-5555-7800002026050401011000209990123686873689"},"RUC":{"type":"string","example":"155555-5-5555"},"Token":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}}}}}},"responses":{"200":{"description":"Consulta exitosa","content":{"application/json":{"schema":{"type":"object","properties":{"Codigo":{"type":"integer","example":"200"},"DescripcionEstatus":{"type":"string","nullable":true,"example":null},"Documento":{"type":"string","example":"FE0120000000155555-5-5555-7800002026050401011000209990123686873689"},"EstadoPersonalizado":{"type":"string","example":"Pendiente"},"EstatusFiscal":{"type":"string","example":"0260"},"FechaUltimaActualizacion":{"type":"string","example":"2026-05-04 16:17:56"},"Mensaje":{"type":"string","example":"Consulta de documento exitosa."}}}}}}}}},"/SubirArchivo":{"post":{"tags":["Subir Documento"],"summary":"Subir documento electrónico","description":"Permite enviar documentos (XML y PDF) en formato Base64 a la plataforma de recepción.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["RUC","Token","Aplicacion","Documento","ListaArchivos"],"properties":{"RUC":{"type":"string","example":"155555-5-5555"},"RNC":{"type":"string","nullable":true,"example":null},"Token":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"Aplicacion":{"type":"string","example":"APIRest"},"Documento":{"type":"string","example":"FE0120000000155555-5-5555-78000320260504000000000209630129015049336"},"DocumentoReferenciado":{"type":"string","example":""},"Verificado":{"type":"boolean","example":true},"Reescribir":{"type":"boolean","example":false},"ListaArchivos":{"type":"array","items":{"type":"object","properties":{"Archivo":{"type":"string","example":"BASE64_AQUI"},"Comentarios":{"type":"string","example":"Comentario del archivo"},"NombreArchivo":{"type":"string","example":"archivo.xml"},"TipoDocumento":{"type":"string","example":"01"},"Extension":{"type":"string","example":"xml"}}}}}},"example":{"RUC":"155555-5-5555","RNC":null,"Token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...","Aplicacion":"APIRest","Documento":"FE0120000000155555-5-5555-78000320260504000000000209630129015049336","DocumentoReferenciado":"","Verificado":true,"Reescribir":false,"ListaArchivos":[{"Archivo":"PD94bWwgdmVyc2lvbj0...","Comentarios":"Este es el XML","NombreArchivo":"FE012000...xml","TipoDocumento":"01","Extension":"xml"},{"Archivo":"JVBERi0xLjQKJ...","Comentarios":"Este es el PDF","NombreArchivo":"FE012000...pdf","TipoDocumento":"01","Extension":"pdf"}]}}}},"responses":{"200":{"description":"Documento procesado correctamente","content":{"application/json":{"schema":{"type":"object","properties":{"Codigo":{"type":"integer","example":"200"},"Mensaje":{"type":"string","example":"Documento procesado."}}}}}}}}},"/CambiarEstado":{"post":{"tags":["Cambiar Estado del Documento"],"summary":"Cambiar estado de documentos","description":"Permite actualizar el estado de una lista de documentos electrónicos.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["Token","RUC","ListaDocumentos"],"properties":{"Token":{"type":"string","example":"eyJhbGciOiJIUzI1..."},"RUC":{"type":"string","example":"155555-5-5555"},"ListaDocumentos":{"type":"array","items":{"type":"object","properties":{"Documento":{"type":"string","example":"01_01_0000000116_001_0000"},"Estado":{"type":"string","example":"8"}}}}}}}}},"responses":{"200":{"description":"Procesado exitosamente","content":{"application/json":{"schema":{"type":"object","properties":{"Codigo":{"type":"integer","example":200},"Mensaje":{"type":"string","example":"Procesado, verifique la respuesta de cada documento"},"RespuestaListaDocumentos":{"type":"array","items":{"type":"object","properties":{"Codigo":{"type":"integer","example":601},"Documento":{"type":"string","example":"01_01_0000000116_001_0000"},"Mensaje":{"type":"string","example":"Estado de documento no se encuentra registrado."}}}}}}}}}}}},"/DescargaArchivo":{"post":{"tags":["Descargar Documento PDF/XML"],"summary":"Descargar archivos de documentos","description":"Permite obtener el contenido en Base64 de un documento electrónico (XML o PDF) almacenado en el sistema.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["Archivo","Extension","Operacion","RUC","Token"],"properties":{"Archivo":{"type":"string","description":"CUFE o identificador del documento a descargar.","example":"FE0120000000155555-5-5555-7800002026050401011000209990123686873689"},"Comentarios":{"type":"string","example":""},"Extension":{"type":"string","description":"Extensión del archivo solicitado (xml/pdf).","example":"xml"},"NombreArchivo":{"type":"string","example":"FE0120000000155555-5-5555-7800002026050401011000209990123686873689"},"TipoDocumento":{"type":"string","example":"01"},"Aplicativo":{"type":"string","example":"Rest"},"Operacion":{"type":"string","example":"Descargar"},"RUC":{"type":"string","example":"155555-5-5555"},"Token":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}}}}}},"responses":{"200":{"description":"Descarga exitosa","content":{"application/json":{"schema":{"type":"object","properties":{"Codigo":{"type":"integer","example":200},"Mensaje":{"type":"string","example":"Descarga exitosa."},"Archivos":{"type":"array","items":{"type":"object","properties":{"Archivo":{"type":"string","description":"Contenido del archivo en Base64.","example":"PD94bWwgdmVyc2lvbj0..."},"FechaCreacion":{"type":"string","nullable":true,"example":null},"Formato":{"type":"string","example":".xml"},"NombreArchivo":{"type":"string","example":"FE0120000000155555-5-5555-7800002026050401011000209990123686873689"},"Tamano":{"type":"string","example":"7 KB"}}}}}}}}}}}},"/ListadoDocumentos":{"post":{"tags":["Listado de documentos"],"summary":"Obtener listado de documentos recibidos","description":"Recupera una lista detallada de documentos electrónicos basados en criterios de fecha, RUC y paginación.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["FechaFin","FechaInicio","RUC","Token"],"properties":{"FechaFin":{"type":"string","example":"2025-07-19 15:24:55"},"FechaInicio":{"type":"string","example":"2022-02-26 00:00:00"},"RangoFin":{"type":"string","example":"100"},"RangoInicio":{"type":"string","example":"0"},"TipoDocumento":{"type":"string","example":"01"},"RUC":{"type":"string","example":"155555-5-5555"},"Token":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}}}}}},"responses":{"200":{"description":"Operación exitosa","content":{"application/json":{"schema":{"type":"object","properties":{"Codigo":{"type":"integer"},"ListadoDocumentos":{"type":"array","items":{"type":"object","properties":{"Emisor":{"type":"string"},"Estado":{"type":"string","nullable":true},"EstatusFiscal":{"type":"string"},"FechaConsignacion":{"type":"string"},"MontoTotal":{"type":"string"},"Numeracion":{"type":"string"},"TipoDocumento":{"type":"string"}}}},"Mensaje":{"type":"string"}}},"example":{"Codigo":200,"ListadoDocumentos":[{"Emisor":"8-879-1899","Estado":null,"EstatusFiscal":"21","FechaConsignacion":"2025-07-19 15:24:53","MontoTotal":"5.94","Numeracion":"FE01100000000008-879-1899-1100002025071905000001350010123275773555","TipoDocumento":"01"},{"Emisor":"8-879-1899","Estado":null,"EstatusFiscal":"21","FechaConsignacion":"2025-07-19 15:24:54","MontoTotal":"5.94","Numeracion":"FE01100000000008-879-1899-1100002025071905000001340010121706932858","TipoDocumento":"01"},{"Emisor":"8-879-1899","Estado":null,"EstatusFiscal":"21","FechaConsignacion":"2025-07-19 15:24:55","MontoTotal":"5.94","Numeracion":"FE01100000000008-879-1899-1100002025071905000001360010124762639480","TipoDocumento":"01"}],"Mensaje":"Procesado, verifique la respuesta de cada documento"}}}}}}}}}