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

# Connect Vinmonopolet to Watchdog

> Capture Vinmonopolet FI files and import their referenced invoice PDFs.

Watchdog preserves Vinmonopolet's FI files and referenced PDFs, then imports invoices from that saved copy.

## Before you begin

Ask Vinmonopolet for the SFTP host, port (usually `22`), username, password or private key, and the server's SHA256 host key fingerprint. A protected private key also needs its passphrase.

The user needs permission to list and read the configured source directory and its `Img` subfolder, and move processed FI files into its `Arkiv` subfolder. With the usual `/Import/FI` source directory, these are `/Import/FI/Img` and `/Import/FI/Arkiv`. Both subfolders must already exist. Ask the server administrator to allow access from the IP addresses Watchdog provides.

## Connect in Watchdog

1. Open **Integrations → SFTP** and add a connection.
2. Enter the credentials and fingerprint. Use `/Import/FI` as the base path unless Vinmonopolet specifies another location.
3. Select **Test Connection**, then save.
4. Select **Capture now** to preserve the available FI files and PDFs.
5. Turn on **Scheduled capture** and choose daily or hourly. It is off by default.
6. Turn on **Auto-sync** if captured invoices should be imported automatically.
7. Choose any supplier filters and select **Sync now** to import a date period.

Supplier choices come from captured FI rows. Watchdog displays a known supplier name when available; otherwise it shows the organization number. Invoice counts cannot currently be estimated for this connection.

## Capture and import schedules

When enabled, **Scheduled capture** preserves files daily at midnight in Europe/Oslo, or hourly if selected. **Auto-sync** controls whether a successful capture also starts an invoice import. These are separate settings: files can be preserved while automatic import is off.

A sync captures files first, or reuses a successful capture from the last hour. Supplier and invoice-date filters apply to import only. Capture preserves all available FI rows and their referenced PDFs.

Once an FI file and all its PDFs are safely stored, Watchdog moves the FI file into `Arkiv`. It leaves PDFs in `Img`. If capture fails, the sync fails; other healthy FI files are still preserved, and retry finishes any pending archive moves.

<Warning>
  Vinmonopolet removes older PDFs around 01:00 on the first day of each month. Confirm that final
  files are available by midnight and resolve capture failures promptly. Manual sync can only cover
  files Watchdog has captured; older history requires a re-export from Vinmonopolet.
</Warning>

## If connection or capture fails

Check the credentials, server fingerprint, network access, and folder permissions. A missing referenced PDF or conflicting invoice identifier prevents that FI file from being archived. Ask Vinmonopolet to correct the source file, then retry **Capture now**.

## Connection and history

Each organization has one SFTP connection for its configured format. The host, port, username and
source directory are fixed when you save it; passwords, private keys and the server fingerprint
can be updated on that same connection. Wait for any active capture before changing credentials.

The first automatic import includes all captured invoices that match your supplier filters,
including older invoice dates. Later automatic imports follow newly captured or updated records.
Use a manual sync for a specific invoice-date period.

Disable a connection to stop capture and import while retaining its history. Connections that
already hold captured files cannot be deleted individually; those files and their index are
removed when the organization is deleted.
