Delete an invoice
Scopeinvoices:writeDeletes a draft invoice. The record is marked as deleted rather than removed.
- Deprecated: use
DELETE /v1/companies/{company_id}/invoices/{invoice_id}, which behaves identically. - Proformas: if the draft came from converting a proforma, deleting it returns that
proforma to
ACTIVE.
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
Invoice ID
uuidHeader Parameters
Which company (tax ID) the request operates on.
An API key belongs to an account, and an account may hold several companies. Endpoints that read or write company-owned data — invoices, customers, products, series, tax and VeriFactu settings — resolve their target company from this header when the path does not already name one.
On a path that names the company, such as /v1/companies/{company_id}/invoices, the path
is the target and this header is not read at all: it neither switches the target nor makes
the request fail, so sending one that disagrees with the path is silently ignored rather
than rejected. Prefer those paths whenever you need to be explicit about which tax ID you
are operating on.
On an account holding a single company the header may be omitted — that company is used.
On an account holding several it is required: the request fails with
403 ACTIVE_COMPANY_REQUIRED otherwise. A company-owned record always belongs to one tax
ID, so operating on it without saying which one has no meaning.
The company does not have to belong to the API key's own account: one you manage works
too, which is what makes the company_id returned by POST /v1/accounts usable here to
invoice on a provisioned account's behalf. What you may do with it is then decided by your
access level over that account, and issuing also requires a signed fiscal representation.
This header is how you operate on a company, never how you find one: a value you do not
reach answers 403, the same as one that does not exist, so guessing reveals nothing. Get
the company_id from the response that created the company.
Requires the companies:read scope. Returns 403 if the company is neither yours nor one
you manage.
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/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": "La factura debe tener al menos una línea",
"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": "FORBIDDEN",
"message": "You do not have permission to access this resource"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource 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 returns it as `application/pdf`. - **Deprecated:** use `GET /v1/companies/{company_id}/invoices/{invoice_id}/pdf/preview`, which behaves identically.
Issue an invoice POST
Finalizes a draft invoice: assigns its definitive number from the configured series and makes it immutable. Irreversible. - **Deprecated:** use `POST /v1/companies/{company_id}/invoices/{invoice_id}/issue`, which behaves identically. - **PDF:** the PDF is generated asynchronously unless `wait_for_pdf` is `true`, which waits for it and returns its URL.