Skip to main content
GET
/
api
/
v1
/
invoices
/
{number}
/
pdf
curl -X GET https://api.yourapp.com/api/v1/invoices/FACT-12345/pdf \
  -H "Authorization: Bearer <local_jwt>" \
  -H "X-Factus-Token: <factus_access_token>"
{
  "message": "PDF obtenido exitosamente",
  "data": {
    "file_name": "FACT-12345.pdf",
    "file_content": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMSAwIFIKL01lZGlhQm94IFswIDAgNjEyIDc5Ml0KL0NvbnRlbnRzIDQgMCBSCi9SZXNvdXJjZXMgPDwKL1Byb2NTZXQgWy9QREYgL1RleHQgXQovRm9udCA8PAovRjEgNiAwIFIKPj4KPj4KPj4KZW5kb2JqCg==",
    "extension": "pdf"
  }
}

Headers

Authorization
string
required
Bearer token for authentication: Bearer <local_jwt>
X-Factus-Token
string
required
Factus access token obtained from authentication

Path Parameters

number
string
required
The invoice number to download as PDF

Response

message
string
Success message
data
object
PDF download response
curl -X GET https://api.yourapp.com/api/v1/invoices/FACT-12345/pdf \
  -H "Authorization: Bearer <local_jwt>" \
  -H "X-Factus-Token: <factus_access_token>"
{
  "message": "PDF obtenido exitosamente",
  "data": {
    "file_name": "FACT-12345.pdf",
    "file_content": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMSAwIFIKL01lZGlhQm94IFswIDAgNjEyIDc5Ml0KL0NvbnRlbnRzIDQgMCBSCi9SZXNvdXJjZXMgPDwKL1Byb2NTZXQgWy9QREYgL1RleHQgXQovRm9udCA8PAovRjEgNiAwIFIKPj4KPj4KPj4KZW5kb2JqCg==",
    "extension": "pdf"
  }
}

Usage Notes

  • The file_content field contains the PDF file encoded in Base64 format
  • To use the file, decode the Base64 string and save it as a .pdf file
  • Example decoding in Python:
    import base64
    
    pdf_content = base64.b64decode(response["data"]["file_content"])
    with open("invoice.pdf", "wb") as f:
        f.write(pdf_content)
    

Build docs developers (and LLMs) love