> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fire.rest/llms.txt
> Use this file to discover all available pages before exploring further.

# KDS Fire credentials

> How fire-kds resolves the Fire host and key for fiscal print and cancel — and what the kitchen sees when Fire rejects a cancel.

This page is for whoever configures print and cancel against Fire. Kitchen operators use the [Fire credentials](/en/manuals/kds/fire-credentials) form in the backoffice; they do not pick env vars.

## Resolution cascade

At runtime fire-kds always walks the same list:

1. **Active vendor row** for the order’s vendor (backoffice **Vendor ID**).
2. **Account default** (empty vendor).
3. **Environment variables** on the fire-kds server.

Print and cancel do **not** share the same env fallback:

| Consumer     | Env after the DB rows                                                              |
| ------------ | ---------------------------------------------------------------------------------- |
| Fiscal print | `FISCAL_PRINT_API_BASE_URL` + `FISCAL_PRINT_API_KEY` only. **Never** `FIRE_API_*`. |
| Cancel       | `FIRE_API_BASE_URL` + `FIRE_API_KEY`, then the fiscal pair if those are empty.     |

The stored API key is the same row for both jobs. Print sends `Authorization: Bearer`. Cancel sends `x-api-key`.

<Note>
  `base_url` is the Fire **host only** (`https://br.app.fire.rest`). fire-kds appends the path. A URL with `/v1/print` is rejected in the backoffice.
</Note>

## Fiscal print call

After credentials resolve, fire-kds requests:

```
GET {base_url}/api/{v1|v2}/restaurant-os/injected-orders/{external_id}/fiscal-print?vendorId={vendorId}
Authorization: Bearer {api_key}
```

* **v1** — Brazil.
* **v2** — Ecuador and later (RIDE layout in `fiscalRepresentation`).

The partner contract is documented in [Fiscal print data](/en/api-reference/fiscal-print). Timeout defaults to 4 seconds. `400` / `401` / `403` are permanent; other failures enqueue a retry.

## Cancel when Fire says no

Cancel uses the same cascade, then `POST` to the XMART cancel adapter with `x-api-key`.

If Fire (or the adapter) returns 4xx:

* The operator sees **Fire rejected the cancellation** plus the policy detail (`reasonDetail`, and threshold/elapsed when present).
* The cancel **job stays failed**. The ticket is **not** marked cancelled.
* The same input is not retried automatically.

A later successful cancel, or a bump, is what clears the ticket from the kitchen.

See [Screen actions](/en/manuals/kds/screen-actions#cancel-an-order) for the operator copy.

## What this is not

* Not Fire Agent (local printer WebSocket). That is [Peripherals, printing and validation](/en/manuals/kds/peripherals-printing).
* Not the catalog of cancellation reasons. Those live in store KDS settings.
