Switch a company off
Scopecompanies:writeSwitches the company (NIF) off in the mode given by environment; the other mode is
untouched.
- Sealed, not deleted: the activation's history survives. After the switch-off takes effect the NIF can neither issue nor correct invoices in that mode until it is switched on again, and in Live that sealing is what releases the NIF for another account.
When it takes effect
- In Live the switch-off is scheduled, not immediate: the cycle is paid up front, so
the response carries an
effective_atand the NIF keeps invoicing until then. Nothing is refunded.effective_atis the end of the current billing cycle, unless the NIF was switched on within that same cycle, in which case it is the end of the next one. TEST, andPRODunder an enterprise contract: immediate, and answer with noeffective_at.
Repeats and permissions
- Repeating the call: on a mode whose switch-off is already pending it returns the same
date with
already_scheduled: true; switching off a mode that was never on is a silent no-op. - Permission: switching off in Live requires being the billing subject of the account.
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
NIF (company) being switched on. 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 NIF you do not reach answers 403, and so does a NIF that does not exist, so the existence of a NIF in another account is never disclosed.
uuidQuery Parameters
Mode to switch the NIF off in.
"TEST" | "PROD"Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://app.beel.es/api/v1/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08/activations?environment=PROD"{
"success": true,
"data": {
"company_id": "b2e6a1c3-1a5e-44ae-a8fd-81f76fd715cf",
"environment": "PROD",
"effective_at": "2019-08-24T14:15:22Z",
"already_scheduled": true
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"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": "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"
}
}Switch a company on POST
Switches an existing company (NIF) on in the mode carried in the body. The mode is always explicit and never taken from the credential's environment, so a Test key can switch a NIF on in Live. ## Modes and billing - **`TEST`:** immediate and free. - **`PROD`:** immediate when the account already has a card on file or an enterprise contract, and the NIF is added to the existing subscription. With no card on file it answers `402 CHECKOUT_REQUIRED`, returning a `checkout_url` when `success_url` and `cancel_url` are supplied. It also requires being the billing subject of the account (`403 NOT_BILLING_OWNER` otherwise). ## Idempotency and pending switch-offs - **Repeating the call:** opens no second checkout and adds no second subscription item; it returns the existing activation with `already_active: true`. The same `Idempotency-Key` sent to this route and to the nested one it replaces is the same operation, so it is replayed and never charged twice. - **A pending switch-off is cancelled:** while it is pending the NIF is still on — it just carries an effective date — so switching it on again only removes that date, answers `scheduled_deactivation_cancelled: true`, and charges or credits nothing.
Get the issuing readiness of a company GET
Returns whether a company (NIF) can issue its STANDARD invoice right now in the environment of the request, and the `blockers` that stop it otherwise. Readiness is a per-NIF property, evaluated independently for each company of the account. - **`ready`:** `true` only when `blockers` is empty. - **Activation:** issuing any fiscal document requires the company to be activated in the environment of that document, whether or not it goes to VeriFactu. - **VeriFactu chain:** the AEAT census and signed representation are additionally demanded only when the company applies VeriFactu by default, the same derivation invoice creation uses when `verifactu_enabled` is omitted. A company with VeriFactu off is ready with a NIF, a default series and an activation. Issuing an invoice with an explicit `verifactu_enabled: true` still enforces the full chain at emission time regardless of this answer, and the separate `verifactu` block reports that chain independently of the setting. - **Not evaluated:** the account's quota or subscription, and the payload of any particular invoice.