beel_create_series
Create an invoice series under a company to assign fiscal numbering by document type, format, and reset policy while enforcing unique codes and AEAT-compliant numbers.
Instructions
Creates an invoice series under a company.
Document type:
document_typeis required.UNASSIGNEDis rejected with422 SERIES_UNASSIGNED_TYPE_NOT_ALLOWED: corrective invoices need a series of their own.Code: must be unique within the company; a code already taken answers
409.Unique numbers per issuer: a series whose
codeandformatcould print a number that another series of the company (in the same environment, active or not) can also print is rejected with409 SERIES_FORMAT_OVERLAPS, naming that series. Proforma series are not compared.Numbering:
formatmust contain{NUM}or{NUM:X}and only accepts uppercase tokens.counter_resetdefaults toANNUAL, so a format with no year token has to be sent withcounter_reset: NEVER.Default series: the first series created for a document type is marked as default even if you send
default_series: false.
Endpoint: POST /v1/companies/{company_id}/series
⚠️ Read before calling:
Fiscal rules, domains numbering: beel_rules_list with domain, or resource beel://guardrails/.
How a series formats numbers, and which series configurations are rejected. (resource: beel://guardrails/series-and-numbering)
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. |