This endpoint retrieves the PDF version of an electronic invoice encoded as a base64 string. The backend proxies the request toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tutosrive/factus_challenge/llms.txt
Use this file to discover all available pages before exploring further.
GET /v1/bills/download-pdf/{number} on the Factus API and returns the result wrapped in the standard response envelope. The base64 string can be decoded client-side to render the PDF inline in a browser, trigger a file download, or store the PDF in a file system.
Endpoint
GET /factura-download/:number
Path Parameter
The full invoice number (e.g.,
SETP990009126). This is the same number value returned in the list endpoint’s data[].number field and in data.bill.number from the get/create endpoints.Request
No request body or query parameters are required. The backend internally callsGET /v1/bills/download-pdf/{number} on the Factus API with the server-stored Bearer token.
Response
200 — Success
Always
200 on success.Always
"OK" on success.The response data object returned directly from the Factus API’s
download-pdf endpoint (GET /v1/bills/download-pdf/{number}). It contains the PDF content encoded as a base64 string. The key name within data is defined by the upstream Factus API response shape for that endpoint.409 — Conflict
Returned when the Factus API responds but with an unexpected status value.500 — Internal Server Error
Two distinct shapes are possible depending on where the error originates: Shape A — upstream call failure (fromrequest_fact internal catch):
message (Axios error message), code (Axios error code), error_name (error class name).
Shape B — controller-level exception:
The
messaje key (with a j) in Shape B is a known typo in the backend source. Shape A uses error as a plain string ("ERROR INTERNO"), not an object.Using the Base64 PDF in a Browser
Once you have the base64 string fromdata, you can decode it and open the PDF in a new browser tab without any server-side file storage:
Code Examples
PDF generation on the Factus sandbox may only be available for invoices that have been successfully validated (
status === 1). Attempting to download a PDF for an unvalidated invoice may result in a 409 response.