# Connect to KSeF: token and environment

Connect your company to KSeF at Settings → KSeF: pick an environment, paste a token from the Taxpayer Application, click Save token, then Verify.

The KSeF connection is a token from the KSeF Taxpayer Application pasted into Settings → **KSeF**; you save a separate token for each environment: test, demo and production.

**Where to find it:** Settings → **KSeF**. Owners and admins can change the settings.

![KSeF settings with the token field and the list of saved connections](https://guilder-desk.dev/help/en/ksef-settings.png)

## Steps

1. In the KSeF Taxpayer Application sign in with a trusted profile or a certificate and generate a token in the **Tokens** tab. Grant it permission to issue and view invoices, and nothing more.
2. In Guilder Desk open **Settings** → **KSeF** → **Add or replace a token**.
3. Choose the **Environment**: **Test**, **Demo** or **Production**. The token must come from the same environment.
4. Paste the value into **KSeF token**. **Context NIP** defaults to your company NIP. If it is empty, fill in the NIP first under Settings → Organization.
5. Click **Save token**. The new token replaces the previous one for that environment and makes it **Active**.
6. Under **Saved connections** click **Verify**. The message "Connection works" means you can send.

## Tips

- Start with the test environment. Its invoices have no legal effect.
- Production is binding and irreversible. The app warns you on screen.
- The token is stored encrypted (AES-256-GCM) and never shown again. You only see the last four characters.
- **Delete** removes the token from the app. Also revoke it in KSeF.
- Without a saved token, sending to KSeF is blocked.

*Updated 2026-11-15*
