Get invoice file URL
Returns a public URL to access the generated invoice file. The file is always regenerated to ensure it reflects the latest invoice settings and data. Files are stored with a hash-based key (invoice ID + file type + document type) to avoid creating duplicate files for the same invoice variant.
What is returned:
- Public URL that can be used to download or access the invoice file
- Filename of the generated file
File types supported:
pdf: PDF with embedded ZUGFeRD/XRechnung XML (hybrid PDF)pdf-without-invoice: PDF without embedded XMLxml-einvoice: XML E-Invoice file (XRechnung format)
Document types supported:
invoice: Standard invoice documentcancel: Cancellation/credit note documentfirst-reminder: First payment remindersecond-reminder: Second payment reminder
File storage behavior: Files are stored with a hash-based key (invoice ID + file type + document type) to ensure the same file URL is returned for the same invoice variant. However, files are always regenerated to ensure they reflect the latest invoice settings and data. This ensures accuracy while maintaining consistent URLs.
Use cases:
- Generate invoice PDFs for customer portals
- Download invoices for accounting purposes
- Access invoice files programmatically
- Share invoice URLs with customers or partners
GET
/billing/invoices/{id}/file-urlAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:reador
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredInvoice ID (UUID)
Query parameters
fileTypestringrequiredType of file to generate
Allowed:
pdfpdf-without-invoicexml-einvoicedocumentTypestringrequiredType of document to generate
Allowed:
invoicecancelfirst-remindersecond-reminderResponses
200Invoice file URL retrieved successfully
filenamestringrequiredFilename of the generated invoice file
urlstringrequiredWorkspace-authenticated URL for the generated invoice file. Send the Public API Bearer token when downloading it.
400Invalid query parameters
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
404Invoice not found
Request
curl -X GET "https://leadtime.app/api/public/billing/invoices/123e4567-e89b-12d3-a456-426614174000/file-url?fileType=pdf&documentType=invoice" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"const response = await fetch("https://leadtime.app/api/public/billing/invoices/123e4567-e89b-12d3-a456-426614174000/file-url?fileType=pdf&documentType=invoice", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
});import requests
response = requests.get(
"https://leadtime.app/api/public/billing/invoices/123e4567-e89b-12d3-a456-426614174000/file-url?fileType=pdf&documentType=invoice",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
},
)Response
{
"filename": "invoice-ACME01-2510-001.pdf",
"url": "https://app.example.com/api/public/workspace/files/file_123"
}Invalid query parameters
Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions
Invoice not found