# Invoice exceptions

Source: https://routineos.org/templates/invoice-exceptions

> Reads incoming invoices, flags duplicates, large amounts and new vendors, the prompt forbids paying. Starts report-only. Install with one command.

Template: finance

# Duplicates, big amounts and new vendors, flagged before anyone pays.

Invoice exceptions is a Claude routine that reads incoming invoices and flags the ones a person should check. It looks for each invoice exception that matters most: a possible duplicate, an amount over your threshold, or a vendor it has not seen. The prompt forbids paying anything.

[Get started](https://routineos.org/#start)[Install it](#install)

unpilotedwatchfinancestarts report-only

At a glance

## Invoice exception checks it runs

Each weekday it lists recent invoices from the mailbox or folder you connect, and reads each one into fields such as vendor, number, amount and due date. The prompt tells it to leave out anything unclear.

A small script then does the checking, not the model. It flags a duplicate, an amount over your threshold, and a vendor that is not on your known list. Every flag is for a person to check, never a decision.

**Kind**Watch

**Schedule**Weekdays, 22:00 UTC (default)

**First run**Report-only

**Needs**An invoice mailbox or folder (read)

**Maturity**Unpiloted: it passed validation, no real run has checked it (per the catalog)

Safety

## What it is told never to do

- The prompt forbids paying, approving, scheduling, replying to or marking anything. The first run is report-only.
- The prompt tells it to leave out an amount or number it cannot read clearly, instead of guessing.
- The prompt treats invoice text as data. An instruction inside an invoice is ignored.
- The prompt forbids writing your settings. If a change looks right, it proposes one and you accept or reject it.

These are rules in the routine's prompt. See [honest limits](https://routineos.org/honest-limits) for what is and is not checked by code.

Settings

## Threshold and vendor settings

| Setting | Key | Default | Note |
|---|---|---|---|
| Flag amounts over | `amount_threshold` | 1000 | 0 to 1,000,000. A lower value means more flags. |
| Known vendor domains | `known_vendors` | none | Vendors not listed are flagged as new. |
| Look back (days) | `lookback_days` | 7 | 1 to 31. A longer window means more invoices to read. |
| Inbox messages per run | `max_inbox_per_run` | 10 | 0 to 30. |

How it runs

## Stages and the invoice connector

| Stage | Kind | Does |
|---|---|---|
| Read invoices | model | Lists recent invoices and reads each into structured fields, leaving out anything unclear. |
| Check for exceptions | code | Flags duplicates, amounts over the threshold and new vendors. |
| Learn | code | Turns feedback on earlier runs into learning and proposals before the write. |
| Write | code | Applies the run under the write contract. |

| Connector | Needed | Used for |
|---|---|---|
| Invoice mailbox or folder | Required | Read incoming invoices. Read access only. |

The Desk

## What the Desk shows

The Desk for this template has two record types, Invoice and Vendor, and two views. Each invoice shows its flags. [How the Desk works](https://routineos.org/concepts/desk).

| View | Shows | Columns |
|---|---|---|
| Recent invoices | Active invoices, newest first seen at the top | Vendor, number, amount, flags |
| Vendors | Vendors, most often seen first | Name, domain |

Install

## Install invoice exceptions

1. **Install the plugin**In Claude Code 2.1.275 or later. The command line tool needs Python 3.11 or later.

`/plugin install routineos --marketplace devkindhq/routineos`

2. **Install the pack**From a clone of the repository root. It writes a routine folder, prints what you must connect, runs nothing and connects nothing.

`python3 skills/routineos/scripts/routineos.py pack install catalog/invoice-exceptions.json --dir my-invoice-exceptions`

3. **Connect, publish, run once**Connect what the pack lists, publish the Desk, and let the first run go. Nothing leaves the routine on the first run.

The [first routine guide](https://docs.routineos.org/guides/first-routine) walks a template to a first run, and [Install a pack](https://docs.routineos.org/templates/install) lists every refusal the installer can give. Free (MIT). Needs a paid Claude plan.

Limits

## Known risks and limits

- Reading a PDF can misread an amount or number. The routine leaves unclear values out, and every flag is for a person to check.
- Duplicate checks look back 90 days of recorded invoices. An older duplicate is not caught.
- Invoice fraud often arrives as changed bank details. The prompt flags it, but this routine is not a fraud control.
- Other mail or storage apps may work. Whether each offers the access needed is unverified.
- Scheduling is a research preview and may change. See [honest limits](https://routineos.org/honest-limits).

Related

## Related templates and reading

 [

### Inbox triage

Labels new mail and drafts replies. Nothing is sent without your yes.

approval-gated
Open ](https://routineos.org/templates/inbox-triage) [

### Use cases

Routines grouped by the team that runs them.

use cases
Open ](https://routineos.org/use-cases) [

### Approvals

How a routine asks before it sends, posts or deletes.

concept
Open ](https://routineos.org/concepts/approvals)

More: [questions and answers](https://routineos.org/faq), [schedule a routine in Claude Code](https://routineos.org/learn/schedule-claude-code), [how RoutineOS maps to Rails](https://routineos.org/concepts/rails-map).

## Read one report before you let it near the books.

Install RoutineOS, add Invoice exceptions, and read its first flags before you rely on them.

[Get started](https://routineos.org/#start)[Read the docs](https://docs.routineos.org)
