18 invoices and receipts logged for October
5 new rows today and 18 this month, totaling $7,412.36. One invoice is still unpaid.
Every weekday evening: invoices and receipts that arrived in Gmail this month, logged as rows in a Google Sheet with vendor, date, amount and status.
Reads
You get
The card on the right is a sample. Yours shows your own numbers and updates in place every run.
What lands on your board
5 new rows today and 18 this month, totaling $7,412.36. One invoice is still unpaid.
Month end starts with your bookkeeper asking for receipts and you searching Gmail for "invoice" across thirty vendors who all word it differently. Half the amounts are in a PDF and two are in euros.
This skill keeps the list current as the month goes. Every weekday it finds new invoices and receipts, reads the vendor, date, amount and number from the email or the attached PDF, and appends one row per document to a sheet your bookkeeper can open. Each row carries the Gmail message ID, so nothing is logged twice.
Call users.messages.list with the query after:2026/10/01 (invoice OR receipt OR "payment received" OR "order confirmation") -in:sent -in:chats, using the first of the current month, plus has:attachment filename:pdf for the same dates.
Read the Message ID column with spreadsheets.values.get on Receipts!H:H and drop every message already in it.
Take the vendor from the From display name or domain, then the date, amount, currency, invoice or receipt number and paid or due from the body. When the amount is only in the PDF, fetch it with users.messages.attachments.get and read the text.
Call spreadsheets.values.append on Receipts!A:H with valueInputOption=USER_ENTERED, one row per document: Date, Vendor, Description, Amount, Currency, Number, Status, Message ID.
New rows today, the month's count and total per currency, unpaid invoices with their due dates, and any document whose amount couldn't be read.
With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.
Pick your agent, where the data comes from and how to schedule it; the commands below follow.
One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.
shellcurl -fsSL https://briefkin.dev/skills/gmail-invoices-and-receipts/install | shAsk Claude Code:
promptRun the gmail-invoices-and-receipts skillOr paste the prompt instead of installing:
promptSearch my Gmail for invoices and receipts received since the 1st of this month (invoice, receipt, payment received, order confirmation, or a PDF attachment), not sent by me. For each, read the vendor, date, amount, currency, invoice or receipt number and whether it is paid or due, from the email or the attached PDF. Check column H of the Receipts tab in my Google Sheet (ID below) and skip any message ID already there. Append the rest with values.append and USER_ENTERED as Date, Vendor, Description, Amount, Currency, Number, Status, Message ID. Tell me how many rows you added, the month's total per currency, unpaid invoices with due dates, and anything whose amount you couldn't read.Weekdays at 18:00, from cron on any machine where Claude Code is signed in:
crontab0 18 * * 1-5 claude -p "Run the gmail-invoices-and-receipts skill"Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.
Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a report card. How setup works
SKILL.md---
name: gmail-invoices-and-receipts
description: "Every weekday evening: invoices and receipts that arrived in Gmail this month, logged as rows in a Google Sheet with vendor, date, amount and status. Use when the user asks for this, or when it runs on a schedule."
---
# Gmail invoices and receipts to Google Sheets
Every weekday evening: invoices and receipts that arrived in Gmail this month, logged as rows in a Google Sheet with vendor, date, amount and status.
Month end starts with your bookkeeper asking for receipts and you searching Gmail for "invoice" across thirty vendors who all word it differently. Half the amounts are in a PDF and two are in euros.
This skill keeps the list current as the month goes. Every weekday it finds new invoices and receipts, reads the vendor, date, amount and number from the email or the attached PDF, and appends one row per document to a sheet your bookkeeper can open. Each row carries the Gmail message ID, so nothing is logged twice.
## Two ways to get the data
Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.
## Route A: API or MCP server
### What you need
- Gmail read access (`gmail.readonly`) through a connector, an MCP server or a Google OAuth client.
- Edit access to the bookkeeping sheet for the same Google account or a service account, and the spreadsheet ID.
If something is missing, say what and stop; do not invent numbers.
### Steps
1. **Search this month's mail** (Gmail): Call `users.messages.list` with the query `after:2026/10/01 (invoice OR receipt OR "payment received" OR "order confirmation") -in:sent -in:chats`, using the first of the current month, plus `has:attachment filename:pdf` for the same dates.
2. **Skip what is already logged** (Google Sheets): Read the Message ID column with `spreadsheets.values.get` on `Receipts!H:H` and drop every message already in it.
3. **Read each document** (Gmail): Take the vendor from the `From` display name or domain, then the date, amount, currency, invoice or receipt number and paid or due from the body. When the amount is only in the PDF, fetch it with `users.messages.attachments.get` and read the text.
4. **Append the rows** (Google Sheets): Call `spreadsheets.values.append` on `Receipts!A:H` with `valueInputOption=USER_ENTERED`, one row per document: Date, Vendor, Description, Amount, Currency, Number, Status, Message ID.
5. **Report**: New rows today, the month's count and total per currency, unpaid invoices with their due dates, and any document whose amount couldn't be read.
## Route B: the browser
### What you need
- Signed in to Google in the browser with the mailbox open, and Editor access to the bookkeeping sheet on the same account.
If something is missing, say what and stop; do not invent numbers.
### Steps
Start at https://mail.google.com/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.
1. **Search this month's invoices**: In Gmail search `after:2026/10/01 (invoice OR receipt OR "payment received" OR "order confirmation") -in:sent -in:chats` with the first of the current month, then a second search `after:2026/10/01 has:attachment filename:pdf -in:sent`.
2. **Open the sheet and check what is logged**: In a second tab open the bookkeeping sheet from https://docs.google.com/spreadsheets/ and the `Receipts` tab. Column H holds the Gmail message ID; for each email, open it, click the three-dot menu, **Show original**, and compare the `Message-ID` line against column H. Skip matches.
3. **Read each new document**: Take the vendor from the sender, then the date, amount, currency, invoice or receipt number and paid or due from the body. When the amount is only in the PDF, click the attachment to preview it in Gmail and read it there.
4. **Add the rows**: In the sheet, click the first empty row under the data and type one row per document: Date, Vendor, Description, Amount, Currency, Number, Status, Message ID. Press Enter after each cell; Sheets saves as you go.
5. **Report**: Rows added today, the month's count and total per currency, unpaid invoices with due dates, and any document whose amount could not be read, with its subject line.
Note: Typing rows into Sheets in the browser is slow: fine for a handful of documents a day, a stopgap for a backlog of a hundred. The Message-ID header from Show original is not the same string as the Gmail API message ID the API route logs, so pick one route for a given sheet or keep both in column H. Scanned PDFs with no text layer cannot be read in the preview either.
## The report
- **New rows** added today, and the month's running count and total per currency.
- The new documents: date, vendor, amount, paid or due.
- Unpaid invoices with their due dates.
- Documents without a readable amount, with a link to the email.
## Post it to Briefkin
When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.
```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
-H "authorization: Bearer $BRIEFKIN_TOKEN" \
-H "content-type: application/json" \
-d @- <<'JSON'
{
"v": 1,
"event_id": "gmail-invoices-and-receipts/<date of this run, e.g. 2026-10-16>",
"item_key": "gmail-invoices-and-receipts",
"project": "Acme",
"source": "Gmail invoices and receipts to Google Sheets skill",
"kind": "update",
"title": "18 invoices and receipts logged for October",
"summary": "**5** new rows today and **18** this month, totaling **$7,412.36**. One invoice is still unpaid.",
"widget": [
{
"type": "Table",
"props": {
"columns": [
"Date",
"Vendor",
"Amount",
"Status"
],
"align": [
"left",
"left",
"right",
"left"
],
"rows": [
[
"Oct 16",
"AWS",
"$1,284.17",
"Paid by card"
],
[
"Oct 16",
"Google Workspace",
"$432.00",
"Paid by card"
],
[
"Oct 15",
"Notion",
"$96.00",
"Paid by card"
],
[
"Oct 15",
"Oakridge Coworking",
"$650.00",
"Paid by transfer"
],
[
"Oct 15",
"M. Ito Design",
"$1,800.00",
"Due Oct 30"
]
]
}
},
{
"type": "Callout",
"props": {
"text": "M. Ito Design invoice #0042 for $1,800.00 is due Oct 30 and not paid yet.",
"tone": "info"
}
}
]
}
JSON
```
Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.
## Run it on a schedule
Suggested: Weekdays at 18:00 (`0 18 * * 1-5`). From cron, with the agent signed in on that machine:
```bash
0 18 * * 1-5 claude -p "Run the gmail-invoices-and-receipts skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```
Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/gmail-invoices-and-receipts#schedule
Source: https://briefkin.dev/skills/gmail-invoices-and-receipts
Gmail read access (gmail.readonly) through a connector, an MCP server or a Google OAuth client.
Edit access to the bookkeeping sheet for the same Google account or a service account, and the spreadsheet ID.
https://gmailmcp.googleapis.com/mcp/v1, in developer preview with the other Google Workspace MCP servers. It needs an OAuth client in Google Cloud set up for an AI agent (setup).gmail.readonly scope, and store GMAIL_CLIENT_ID, GMAIL_CLIENT_SECRET and GMAIL_REFRESH_TOKEN. Publish the OAuth app (or make it Internal in Workspace): refresh tokens from an app left in Testing expire after seven days.gmail.readonly can search and read but not send, delete or relabel; add gmail.compose only if you want the agent to leave drafts.
https://sheetsmcp.googleapis.com/mcp/v1, part of the Google Workspace MCP servers in developer preview, with read-only spreadsheets.readonly and drive.readonly scopes available (setup).GOOGLE_APPLICATION_CREDENTIALS and SHEET_ID (the long ID in the sheet's URL). Use the spreadsheets.readonly scope unless the skill appends rows.Share the sheet with the service account as Viewer unless the skill writes; it can only open files someone shared with it, so the rest of your Drive stays out of reach.
No. Each row keeps the amount and currency as printed, and the card totals each currency on its own. Conversion belongs in the bookkeeping software, which uses the rate on the payment date.
Text PDFs are read directly. A scan with no text layer is logged with the vendor and date, an empty amount and the status "amount not found", so it still reaches your bookkeeper's list.
No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a report card, so you can glance at it instead of asking again.
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.
Yes. Switch the data source to "Your browser" and the steps change to the Gmail and Google Sheets pages themselves: the agent opens mail.google.com in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.
Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.
Free during the open beta. No card.