Delete a draft invoice
Scopeinvoices:writeDeletes a draft invoice of this company. The record is marked as deleted rather than removed.
- Issued invoices: never deleted. They are voided with
POST …/{invoice_id}/void, which leaves the fiscal trail. source_proforma_id: when the draft came from converting a proforma, deleting it returns that proforma fromCONVERTEDtoACTIVE, editable and convertible again. Voiding or rectifying an issued invoice does not return its proforma; only deleting the draft does.
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
curl -X DELETE "https://app.beel.es/api/v1/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08/invoices/550e8400-e29b-41d4-a716-446655440000"{
"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"
}
}Preview the PDF of a draft invoice GET
Renders the PDF of a draft invoice on the fly, without storing it and without consuming numbering, so each call reflects the latest changes. The response is `application/pdf`. - **Document:** shows `BORRADOR` in place of the invoice number and carries no VeriFactu QR code. The issuer block is taken from the company in the path. - **Drafts only:** an invoice that is not a draft answers `400` — it has a stored PDF, available at `GET …/{invoice_id}/pdf`.
Issue an invoice POST
Finalizes a draft invoice of this company: assigns its definitive number from the configured series and makes it immutable. - **Irreversible:** an issued invoice is corrected with a corrective invoice (`POST …/{invoice_id}/corrective`) or voided (`POST …/{invoice_id}/void`), never edited. - **Asynchronous:** PDF generation and submission to the AEAT happen after the response, so a `200` means the invoice was accepted for submission, not that the AEAT has registered it. Use `wait_for_pdf` to wait for the PDF. - **Nothing to collect:** a `STANDARD` or `SIMPLIFIED` invoice whose `total_to_pay` is 0 is issued as `PAID`, with `payment_date` equal to `issue_date`. It is registered with the AEAT like any other invoice, with a total of 0.