Get the preview image URL of an invoice
Scopeinvoices:readReturns a temporary pre-signed URL to a preview image (WebP) of the invoice, suitable for
inline rendering. The image is generated and cached on first request, so a later call
returns the cached image. The URL expires in five minutes and only allows GET.
The image of an issued invoice is taken from its stored PDF, the one delivered. While that
PDF does not exist yet — right after issuing (whether or not the invoice goes through
VeriFactu, since the PDF is generated asynchronously) or, for a VeriFactu invoice
specifically, while it waits for the QR of its registration — the answer is 202, as for
the PDF download.
Keys are prefixed beel_sk_, and each one carries the scopes it was created with: a key
short of the scope an operation needs is answered 403. The scope an operation requires
is shown next to its title, and the full catalogue lives in the Scopes reference.
Keys are created from the BeeL dashboard. They are secret credentials: do not share them or commit them to source control.
In: header
Path Parameters
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.
uuidInvoice ID
uuidResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://app.beel.es/api/v1/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08/invoices/550e8400-e29b-41d4-a716-446655440000/preview"{
"success": true,
"data": {
"image_url": "https://storage.example.com/beel-invoices/invoices/user-uuid/factura-uuid_preview.webp?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...",
"expires_in_seconds": 300
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The provided data is not valid",
"details": {
"field": "specific error message"
}
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
},
"type": "https://docs.beel.es/errors/INVOICE_NO_LINES",
"title": "INVOICE_NO_LINES",
"detail": "The invoice must have at least one line",
"instance": "/v1/invoices/abc-123"
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication is required to access this resource"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The provided data is not valid",
"details": {
"field": "specific error message"
}
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
},
"type": "https://docs.beel.es/errors/INVOICE_NO_LINES",
"title": "INVOICE_NO_LINES",
"detail": "The invoice must have at least one line",
"instance": "/v1/invoices/abc-123"
}{
"success": false,
"error": {
"code": "INVOICE_NOT_FOUND",
"message": "Invoice not found"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again in 60 seconds."
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "UNSUPPORTED_MEDIA_TYPE",
"message": "Unsupported media type: text/plain. Supported: application/json"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Get the PDF download URL of an invoice GET
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 with `Prefer: wait=0`. - **`202`:** only when the wait elapsed with the PDF still in flight. No body is returned; ask again after `Retry-After`. - **Drafts:** a draft has no fiscal PDF and answers `400 INVOICE_NOT_ISSUED_NO_PDF` immediately — that one never waits. Issue it, or render it with `GET …/{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_PDF` immediately. Its `verifactu.error_message` says 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 `status` to know it.
Download the PDFs of several invoices as a ZIP POST
Returns a single ZIP with the PDFs of the invoices of this company named in `invoice_ids`. - **Limit:** up to 500 invoices per request. - **Missing PDFs:** invoices whose PDF is not available are left out of the archive. If no PDF at all is available the call fails with `400`. - **Counts:** `X-Bulk-Total`, `X-Bulk-Successful` and `X-Bulk-Failed` response headers report how many PDFs were requested and how many made it into the ZIP.