beel_create_company
Creates a Spanish company (NIF) under your account for VeriFactu compliance, activates it in AEAT test or production, and seeds three default invoice series (ordinary, simplified, corrective).
Instructions
Creates a company (NIF) under the account in the path and, unless activate is false,
switches it on in aeat_environment and seeds its three default invoice series (ordinary,
simplified, corrective). The optional numbering block decides the code, format, counter
reset and starting number those series are born with, and is only accepted when the
request activates the company.
A NIF that already exists in the account is rejected with 409; the response carries the
existing error.details.company_id. This endpoint never switches an existing company on
and never starts a charge: creating a production NIF on an account without billing is
rejected with 402 and no checkout is opened. Switching an existing NIF on is
POST /v1/companies/{company_id}/activations. The company is created under the account
the request resolves to, and the NIF is registered in the name of that account's holder,
never in the name of the caller.
Endpoint: POST /v1/accounts/{account_id}/companies
⚠️ Fiscal guardrails — read before calling:
Which company an operation acts on, and how that is selected. (resource: beel://guardrails/multi-nif)
Why a name that does not match the census makes an invoice unsubmittable. (resource: beel://guardrails/nif-validation)
How invoice numbers are formed, and why numbering can never be rewritten. (resource: beel://guardrails/series-and-numbering)
For the exhaustive rules and worked examples, call beel_docs_search.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| account_id | Yes | Your own account, or an account you provisioned. It — not the credential — decides which account the operation acts on; a `403` is returned when you do not reach it, the same response an account that does not exist gets. | |
| 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. |