empresa_required
The endpoint is empresa-scoped and no `Facturia-Empresa` header was sent.
The endpoint is empresa-scoped and no Facturia-Empresa header was sent.
| Code | empresa_required |
| Type | invalid_request_error — Malformed or incomplete input |
| HTTP | 400 |
| Retriable? | No |
What to do
Send the canonical RUT or the emp_… id in the Facturia-Empresa header (also in error.param). There is no query parameter alternative. If error.details says reachable_empresas: 0 the header is not the problem: this credential reaches no empresa yet, and error.details.next is the call that creates one.
Retrying the same request will fail the same way. Change the request, not the frequency.
The envelope
{
"error": {
"type": "invalid_request_error",
"code": "empresa_required",
"message": "…",
"hint": "Send the canonical RUT or the `emp_…` id in the `Facturia-Empresa` header (also in `error.param`). There is no query parameter alternative. If `error.details` says `reachable_empresas: 0` the header is not the problem: this credential reaches no empresa yet, and `error.details.next` is the call that creates one.",
"retriable": false,
"doc_url": "https://docs.facturia.cl/errors/empresa_required",
"request_id": "req_01K2R7Q9M4T2VB"
}
}Program against code, never against message — the prose can be rewritten, the code cannot (§5.8).
hint and retriable arrive in the response with these exact values: they are a function of code and come from the same dictionary GET /v1/error_codes serves, so the envelope and the dictionary cannot disagree. Both are English on the wire by design — one registry, one language. More in The error envelope.
See also
Every code
The error envelope
The machine-readable copy of this page lives at GET /v1/error_codes, unauthenticated.