# Capture invoices from Chrome

> Install Vestiarion Invoice Capture, connect it to your workspace, capture an invoice you select or choose, check its fields and send it as a draft that an owner or admin adds as a bill on Bills & receivables. It never pays.

Vestiarion Invoice Capture is a Chrome extension that brings an invoice from your browser into your workspace as a draft: the text you select on a supplier's portal, in a web mail or in a PDF, or a file you choose. You check the fields it read, send the draft, and it waits on **Bills & receivables** until an owner or admin adds it as a bill or discards it. The extension never adds a bill, approves or pays: once a person adds the draft, the agent decides the bill as any other, and pays on the workspace's network, Arc mainnet or Arc testnet, under every check it applies.

## 1. Install it

1. Open [Vestiarion Invoice Capture on the Chrome Web Store](https://chromewebstore.google.com/detail/vestiarion-invoice-captur/jfhjgbdbolhnneomgifdnjamoldlioan) and choose **Add to Chrome**. Its ID there is `jfhjgbdbolhnneomgifdnjamoldlioan`.
2. Pin Vestiarion Invoice Capture to the toolbar, so its icon is one click away.

Chrome keeps the store's copy up to date on its own.

> **Note: Or load the downloaded copy** Where the Chrome Web Store is not available, download [vestiarion-invoice-capture.zip](https://www.vestiarion.xyz/downloads/vestiarion-invoice-capture.zip) and extract it, keeping the folder where it is. In Chrome, open `chrome://extensions`, turn on **Developer mode**, choose **Load unpacked** and pick that folder, the one with `manifest.json` in it. Every downloaded copy has the same ID, `pemkppoklecedoebjfgjlgfibbepikki`, which Vestiarion allows as it does the store's. To update it, download the zip again, replace the folder's files and choose the reload arrow on its card. Its connection stays.

The extension asks for six permissions, each for one reason, and for no site: `activeTab` and `scripting` to read the text you selected when you press Capture, `storage` to keep its connection on this computer, `identity` to open Vestiarion's sign-in window, `contextMenus` for the menu on a selection, and `alarms` to drop a selection taken from that menu after 5 minutes. It talks to www.vestiarion.xyz alone, which answers this extension by its ID, and never sends your cookies.

## 2. Connect it to your workspace

Sign in to Vestiarion in a tab first. Then click the extension's icon.

1. The first time, **Before you start** says what is sent and when. Choose **Continue**.
2. Choose **Connect Vestiarion**. Chrome opens Vestiarion's page **Connect Vestiarion Invoice Capture** in a small window.
3. Pick the workspace drafts go to. Only workspaces where you are an owner or admin are offered, since adding a bill is theirs.
4. Read what it can and cannot do, and choose **Allow**. The window closes, and the popup names the workspace.

The page says what the extension can do: "Create drafts here, and read and change the drafts it created until you send them." And what it cannot: "Add a bill, approve or pay anything, or touch a wallet." It never sees your password or an API key: Vestiarion gives it a token that opens its own drafts and nothing else, for an hour at a time, renewed while it is in use, and never for more than 90 days from connecting; then you connect again.

If the window says **Sign in to connect the extension**, sign in to Vestiarion in a tab, come back to the window and choose **Continue**. With Google, you can sign in in the window itself.

## 3. Capture an invoice

- **Capture selected text**: select the invoice's text on the page, click the icon and press it. Only the selected text is sent.
- **Capture invoice with Vestiarion**: the menu you get by right-clicking a selection, which works in Chrome's PDF viewer too. The popup shows the text it took and sends it only when you press **Send to Vestiarion**, within 5 minutes; after that it is dropped.
- **Choose a file**: a PDF with text, a `.txt` or an `.eml` file of at most 4 MB is read as **From a document** reads one. A picture is sent, not read: "A picture is not read. Type the invoice's fields from it, then send the draft."

Vestiarion reads the supplier, the invoice number, the amount, the currency, the invoice date, the due date, the purchase order and a memo, with its model provider (DeepSeek, on the hosted service), as it reads an invoice you upload, and checks each figure against the document. The popup shows them to edit, and says what is still missing, for instance "No due date was read. Add the day it is due." Notes about the document come with them, such as a date that can be read two ways.

Choose **Send draft**. **Sent for review** says where it waits, and **Open in Vestiarion** opens it there. A draft not sent stays in the popup until you send it or start over, and is deleted within 7 days of when you captured it. One connection keeps at most 50 drafts not sent.

## 4. Add it as a bill in Vestiarion

On **Bills & receivables**, **Waiting for review** names the drafts sent, such as "2 captured", which opens **Captured drafts** beside the page. Each shows what was read, who captured it and when, the counterparty it matched and what to check. **What was captured** shows the text it was read from when you open it.

An owner or admin chooses:

- **Review and add as bill**: the invoice form opens with what was read. Choose the counterparty, fix any field, tick **Goods or services received** if you have them, and choose **Add as bill**. It is added through the same command as every bill, so the counterparty's screening, the form's checks and the agent's decision apply exactly as to one typed in. A supplier not yet in Counterparties has a link to add it, with its name filled in.
- **Discard**: the draft leaves the list.

A draft that may repeat a bill already in the workspace, or another captured draft with the same invoice number, says **This may be a duplicate** and names it. Adding it then needs **This is not a duplicate** ticked, and the check runs again with the counterparty, amount and due date you chose. If the bill was added but its ledger entry could not be written, Vestiarion says so and keeps the bill: it is never added a second time.

As for an invoice that arrived by email, the form for a captured draft offers no project, and in shadow mode no bill in your own currency: it adds the bill in USDC or EURC. Put the bill in a project afterwards with **Put in this project** on the project's page, or add a bill in your own currency from the New menu instead.

## What it can and cannot do

| The extension can | It cannot |
| --- | --- |
| Send text you select, or a file you choose, to your workspace to be read | Read a page unless you press Capture in it |
| Create drafts, and read and change its own until they are sent | Add a bill, approve, pay or touch a wallet |
| Show you the fields read and what is missing | See bills, counterparties, members, wallets, API keys or anything else |

A person's role is read again at every request: an owner or admin who becomes an approver can no longer send drafts, and the connection ends; made an admin again, they connect again. Leaving the workspace ends the connection too.

## What is kept, and for how long

- The draft's fields, who captured it and when, and what became of it are kept with the workspace.
- The text it was read from is kept for the reviewer until the draft is added or discarded, and at most 30 days.
- A draft never sent is deleted within 7 days.
- A file is never kept, only its SHA-256.
- What you capture goes to Vestiarion, which reads it as it reads an invoice you upload: the model provider (DeepSeek, on the hosted service) sees its text, under that provider's own API terms. Read DeepSeek's [API terms](https://cdn.deepseek.com/policies/en-US/deepseek-open-platform-terms-of-service.html) and [privacy policy](https://cdn.deepseek.com/policies/en-US/deepseek-privacy-policy.html). The [privacy page](https://www.vestiarion.xyz/privacy#chrome-extension) says more. The extension has no analytics, and nothing about an invoice goes to an analytics service.
- In the extension, the access token is kept in memory only and the refresh token on this computer, until you disconnect.

## Disconnect it

**Disconnect** in the popup ends the connection at once. In Vestiarion, **Settings** lists each connected extension under **Chrome extension**: yours, or for an owner or admin everyone's in the workspace, each with **Disconnect**.

## What the ledger records

- `extension_connected` and `extension_disconnected`, with the connection's id, never a token, and why it ended: its own Disconnect, Settings, a role that can no longer add bills, a membership that ended, or a code or refresh token used again.
- `invoice_draft_captured` when a draft is sent for review: the draft, where it came from and the document's hash, never the text.
- `invoice_draft_confirmed` and `invoice_draft_discarded` when a person decides it. The bill's own `create_invoice` entry names `via: "chrome"`, the draft and the invoice number, and the fields changed from what was read.

## For the person who runs the deployment

Set `CHROME_EXTENSION_IDS` to the extension IDs allowed to connect, separated by commas, such as the ID `chrome://extensions` shows for a copy loaded from the repository's own `extensions/chrome-invoice-capture/extension` folder, which comes from the folder's path. Once any ID is listed, two more are allowed too: the Chrome Web Store's copy, `jfhjgbdbolhnneomgifdnjamoldlioan`, and the downloaded copy, `pemkppoklecedoebjfgjlgfibbepikki`, whose manifest carries a public key that gives every copy that one ID. After changing the extension, run `npm run extension:download` and commit `public/downloads/vestiarion-invoice-capture.zip`; a test fails until the zip matches the extension's files. Migration `0121_invoice_capture.sql` adds the drafts and the connections. Without either, the extension's endpoints answer 503, the consent page says invoice capture is not set up, and nothing else changes.
