---
search:
  tags:
    - billing
    - GET
seo:
  description: >-
    Returns a public URL to access the generated invoice file. The… Reference
    for the GET /billing/invoices/{id}/file-url endpoint in the Leadtime Public
    API API.
sidebar:
  badge: GET
  label: Get invoice file URL
title: Get invoice file URL
type: openapi-operation
---
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

<Operation source="api-reference" id="invoicescontroller-getinvoicefileurl" />
