Skip to content
Leadtime
English
Esc
↑↓navigate↵open⌘Jpreview

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 XML
  • xml-einvoice: XML E-Invoice file (XRechnung format)

Document types supported:

  • invoice: Standard invoice document
  • cancel: Cancellation/credit note document
  • first-reminder: First payment reminder
  • second-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-url
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:read
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
idstringrequired

Invoice ID (UUID)

Query parameters
fileTypestringrequired

Type of file to generate

Allowed:pdfpdf-without-invoicexml-einvoice
documentTypestringrequired

Type of document to generate

Allowed:invoicecancelfirst-remindersecond-reminder
Responses
200

Invoice file URL retrieved successfully

filenamestringrequired

Filename of the generated invoice file

urlstringrequired

Workspace-authenticated URL for the generated invoice file. Send the Public API Bearer token when downloading it.

400

Invalid query parameters

401

Unauthorized - Invalid or missing authentication token

403

Forbidden - Insufficient API scopes or permissions

404

Invoice not found

Try it
Server
Authorization
Parameters
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"
Response
{
  "filename": "invoice-ACME01-2510-001.pdf",
  "url": "https://app.example.com/api/public/workspace/files/file_123"
}