beel_create_invoice_derivation
Duplicate an existing invoice into a new draft without altering the source. The copy resets number, status, dates, and VeriFactu data, ready for changes.
Instructions
Creates a draft invoice derived from an existing invoice of this company. The source
invoice, named in from_invoice_id, is not modified.
mode: the only value isDUPLICATE, which copies the source into a fresh draft. Recipient, lines, payment method, series and observations are copied; number, status, dates, VeriFactu data and PDF are reset.Series: the one sent in
series_id, or the source's when omitted. It is validated against the type of the copy, which is not always the source's: the copy of aCORRECTIVEis bornSTANDARD. An incompatible series fails with422 SERIES_INCOMPATIBLE_DOC_TYPE.
Endpoint: POST /v1/companies/{company_id}/invoices/derivations
⚠️ Fiscal guardrails — read before calling:
When an invoice can still be changed, and what to do once it cannot. (resource: beel://guardrails/invoice-state-machine)
For the exhaustive rules and worked examples, call beel_docs_search.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| 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. | |
| idempotency_key | No | Optional idempotency key for this operation. Omit it and one is derived from the request itself, which makes a blind retry safe but also collapses a SECOND, deliberately identical operation into the first for 24 hours. Set it — to an order id, or anything unique per intended operation — whenever you mean to create something that may look identical to what you just created. |