Download an invoice PDF
Download the authenticated PDF for an already issued TPV invoice from the ticket detail. The action uses the invoice file already attached to the ticket and does not create, resend, regenerate, or fiscally submit the invoice.
In this article
Use this guide when a Harbor Soho ticket already has an issued invoice and the invoice has a PDF document attached.
The operator starts from the TPV ticket, opens the ticket actions, and asks the browser to save the authenticated PDF. The ticket, invoice status, delivery history, and fiscal submission state stay unchanged.
Before you start
- The operator is signed in to Antylogic with access to Harbor Demo Group and Harbor Soho.
- The operator can open the Harbor Soho TPV ticket detail and has TPV access for the location.
- The ticket detail includes an invoice object.
- The invoice has a non-empty invoice.file_id after trimming whitespace.
- The action is run in the web app because the download uses browser document and object URL APIs.
- The file service and filestore are configured, and the fileId resolves to an existing PDF object.
Instructions
- 1.
Open the invoiced ticket
Open the Harbor Soho TPV ticket detail for the paid or invoiced ticket. In the GB demo, use the ticket route with ORG_ID, LOCATION_ID, TPV_TERMINAL_ID and Olivia Hart's TPV_STAFF_ID. Confirm that invoice information is visible before continuing.
- 2.
Open the ticket actions
Open the ticket action menu from the ticket header. When the ticket already has an invoice with a document file, the menu exposes Download invoice as the document action.
- 3.
Start the PDF download
Select Download invoice. Antylogic trims invoice.file_id, requests the authenticated file as a blob, and asks the browser to save it with a PDF filename built from the invoice series and number when available.
- 4.
Use the invoice card shortcut when visible
If the issued invoice card shows Open document, the operator can use it instead of the ticket menu. It uses the same file_id validation and authenticated file download path.
- 5.
Handle missing documents
If Antylogic says the invoice does not yet have a PDF available, the ticket has an invoice record but no attached document file. Generate or attach the invoice PDF through the issuing or delivery workflow before trying this download again.
Validations and limits
- The ticket detail only loads when ticketId, orgId, locationId and TPV use access are available.
- Download invoice is usable only when invoice.file_id is present after trimming whitespace.
- The file request goes to GET /api/app/files/{fileId}; there is no ticket-scoped invoice document endpoint in the reviewed implementation.
- downloadAuthenticatedFile rejects an empty fileId and requires a browser runtime with document, URL and URL.createObjectURL.
- The backend file route requires an authenticated request, reads file metadata, streams the stored object, and returns content type, length when known, and Content-Disposition when a stored filename exists.
- This is a read-only action: it does not create an invoice, regenerate the PDF, mark delivery, send email, or submit Verifactu.
Expected result
The browser starts downloading the authenticated invoice PDF that is already attached to the ticket invoice. No ticket, invoice, delivery, or fiscal state changes are made.