factus-js iconfactus-js
Documentos soporte

Descargar PDF

Descargar PDF de un documento soporte en base64 por numero.

Firma del método

downloadPdf(
  number: string,
  options?: RequestOptions,
): Promise<DownloadSupportDocumentPdfResponse>

Endpoint Factus

GET /v2/support-documents/{number}/download-pdf

Fuente oficial: Descargar PDF

Parámetros

Prop

Type

Ejemplo

const response = await factus.supportDocuments.downloadPdf("SEDS984000085");
const pdfBuffer = Buffer.from(response.data.pdf_base_64_encoded, "base64");

Ejemplo de respuesta

{
  "status": "OK",
  "message": "Solicitud exitosa",
  "data": {
    "file_name": "ds09017242540002500000006",
    "pdf_base_64_encoded": "[TRIMMED_BASE64_60832_CHARS]"
  }
}

En esta página