Facturas
Descargar XML
Descargar XML de una factura en base64 usando el numero del documento.
Firma del método
downloadXml(
number: string,
options?: RequestOptions,
): Promise<DownloadBillXmlResponse>Endpoint Factus
GET /v2/bills/{number}/download-xml
Fuente oficial: Descargar XML
Parámetros
Prop
Type
Ejemplo
const response = await factus.bills.downloadXml("SETP990000203");
const xml = Buffer.from(response.data.xml_base_64_encoded, "base64").toString(
"utf-8",
);Ejemplo de respuesta
{
"status": "OK",
"message": "Solicitud exitosa",
"data": {
"file_name": "fv09008257590002400000241",
"xml_base_64_encoded": "[TRIMMED_BASE64_20808_CHARS]"
}
}