Facturiadocs

mode_mismatch

A live credential named a sandbox empresa, or the reverse.

A live credential named a sandbox empresa, or the reverse.

Codemode_mismatch
Typepermission_error — Valid credential, not allowed
HTTP403
Retriable?No

What to do

Mode comes from the key prefix and the empresa is one or the other; §4.2 makes them invisible to each other in BOTH directions. An sk_test_ key drives a fully mocked sandbox, so it may only address a sandbox empresa — against a live one the door would accept a mocked document that the engine then refuses. Uniqueness is per mode, so the same RUT can hold a sandbox empresa and a live one at once: create the sandbox copy, or use the key that matches. ambiente is a separate axis and comes from the empresa (§4.1).

Retrying the same request will fail the same way. Change the request, not the frequency.

The envelope

{
  "error": {
    "type": "permission_error",
    "code": "mode_mismatch",
    "message": "…",
    "hint": "Mode comes from the key prefix and the empresa is one or the other; §4.2 makes them invisible to each other in BOTH directions. An `sk_test_` key drives a fully mocked sandbox, so it may only address a sandbox empresa — against a live one the door would accept a mocked document that the engine then refuses. Uniqueness is per mode, so the same RUT can hold a sandbox empresa and a live one at once: create the sandbox copy, or use the key that matches. `ambiente` is a separate axis and comes from the empresa (§4.1).",
    "retriable": false,
    "doc_url": "https://docs.facturia.cl/errors/mode_mismatch",
    "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

The machine-readable copy of this page lives at GET /v1/error_codes, unauthenticated.

On this page