beel_get_invoice_pdf
Retrieve a temporary pre-signed URL to download an issued invoice's PDF, with an optional short wait for asynchronous generation and clear errors for drafts or unregistered invoices.
Instructions
Returns a temporary pre-signed URL to download the invoice PDF.
URL: expires in five minutes and only allows
GET.Waiting: a PDF is produced asynchronously, so this request waits for it (up to ten seconds) instead of handing you a polling loop to write. Bound the wait with
Prefer: wait=N, or opt out withPrefer: wait=0.202: only when the wait elapsed with the PDF still in flight. No body is returned; ask again afterRetry-After.Drafts: a draft has no fiscal PDF and answers
400 INVOICE_NOT_ISSUED_NO_PDFimmediately — that one never waits. Issue it, or render it withGET …/{invoice_id}/pdf/preview.Not registered with the AEAT: under VeriFactu the PDF carries the QR code of the invoice's registration. An invoice whose registration was rejected before reaching the AEAT, or that was voided without ever being registered, has no PDF and answers
400 INVOICE_NOT_REGISTERED_NO_PDFimmediately. Itsverifactu.error_messagesays why.Never modified: the PDF of an issued invoice is generated once — with its VeriFactu QR when it applies — and stays the document you delivered. Voiding the invoice or issuing a corrective against it does not change the PDF: read the invoice's
statusto know it.
Endpoint: GET /v1/companies/{company_id}/invoices/{invoice_id}/pdf
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| company_id | Yes | Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. | |
| invoice_id | Yes | Invoice ID |