beel_patch_company
Update editable company fields like legal name, address, and bank details for BeeL Spanish e-invoicing. Includes AEAT census validation for name changes and test-credential limits on live companies.
Instructions
Updates the editable fields of a company; the set is the one
UpdateCompanyRequest declares.
Immutable fields:
nif,entity_typeandlegal_form, once set. Sending one of them with a different value answers422with a code that names the field; sending the value it already has is not a change.legal_name: changing it requires the NIF to pass an AEAT census re-validation. For a legal entity (LEGAL_ENTITY) the census identifies the company by its NIF alone: the name is not verified, so the name sent cannot make it fail. For anINDIVIDUALthe name must match the one the census holds for that NIF.Census not answering: if the AEAT census cannot be reached, the change is not rejected. The response is
200with the newlegal_namestored, and BeeL repeats the census check in the background. The outcome of that check is not part of this resource: no field ofCompanyDatacarries it. To know what the census says about a NIF and a name, askPOST /v1/nif/validate.Addresses: a Spanish postal code (
country_codeomitted orES) must have 5 digits, inaddressand inlegal_representative.address; otherwise422 POSTAL_CODE_INVALID_ES. Other countries' postal codes are free-form.
Test credentials on a Live company
Once the company is activated in Live, a test credential may only write the fields that
affect how the invoice looks: logo_url, invoice_accent_color,
invoice_template_type, invoice_language, email_language and additional_info. Any
other field describes the real business — fiscal address, legal representative, bank
details, contact data, IAE, activity start date, payment term — and answers
422 FISCAL_IDENTITY_LIVE_ONLY from Test, since the company is a single record shared by
both modes. A company not activated in Live accepts the whole body from Test, and sending
a field its current value is never a change.
What comes back
The 200 returns CompanyData with every field this request accepts, under the same
name and the same type — so the response is the confirmation of what was stored, and a
later GET says the same. A field you never set comes back absent, which means "nothing
stored", not "hidden".
Two things live outside this body and keep their own reads: the invoice series
(GET /v1/companies/{company_id}/series) and the rendering block, which is also served
on its own by GET /v1/companies/{company_id}/invoice-customization.
Endpoint: PATCH /v1/companies/{company_id}
⚠️ Read before calling:
Which company an operation acts on, and how that is selected. (resource: beel://guardrails/multi-nif)
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. |