Download an invoice
Compliance artefacts are downloaded from the Sylius Admin compliance area. They are not exposed through public filesystem URLs.
Preconditions
You need:
- an authenticated Sylius Admin session;
- a generated compliance document;
ROLE_SYLIUS_INVOICE_COMPLIANCE_DOWNLOADto download Factur-X or XML artefacts.
The compliance document list is available at:
/admin/compliance/documents
The download actions are only presented to administrators who have the download permission.
Download the Factur-X PDF
From the compliance document list, use the Factur-X download action. The underlying route is:
GET /admin/compliance/documents/{id}/download/factur-x
A successful response contains the governed Factur-X PDF as an attachment named compliance-document-factur-x.pdf.
Download the structured XML
Use the XML download action or its route:
GET /admin/compliance/documents/{id}/download/xml
A successful response contains the structured XML as application/xml; charset=UTF-8, with the attachment name compliance-document.xml.
Preview the governed document
For an inline representation, the Admin also exposes:
GET /admin/compliance/documents/{id}/document
It returns the Factur-X PDF when available, with XML as the fallback representation.
Integrity and error handling
Invoice checks the stored SHA-256 integrity before returning bytes.
| HTTP status | Meaning |
|---|---|
200 |
The requested artefact exists and passed its integrity check. |
404 |
The document or requested stored artefact is missing. |
409 |
The stored artefact no longer matches its recorded integrity hash. Do not bypass this error by serving the file directly. |
Download responses are private and no-store; the plugin also sends nosniff protection. Do not replace these routes with a public storage URL.
If an artefact is legitimately missing, use the controlled recovery procedure in Regenerate an invoice. For the storage model, see Storage and integrity and PDF and Factur-X.