The AgentivUse cases

Finance · An afternoon · Thailand

Snap the tax invoice, the sheet fills itself

An agent that reads a receipt or tax invoice photo sent on LINE, checks the 13 digit tax ID, the Buddhist era date and the 7% VAT in code, logs the row to Google Sheets and tells the sender what still needs a look

The problem

In a Thai shop or small company the receipts and tax invoices arrive as photos on LINE from whoever paid: a driver, a cook, the owner's spouse. Someone types the seller, the tax ID, the date in Buddhist era and the VAT into a sheet weeks later, and a wrong digit in the tax ID or a VAT line that does not add up only shows when the accountant prepares the monthly VAT return.

Architecture

  1. Channel
    • Receipt photo on the LINE OA
  2. Agent
    • Claude structured output
    • Checks in code, review flag
  3. Tools
    • n8n workflow
    • Google Sheets Receipts tab
    • LINE reply
  4. Human
    • Bookkeeper opens flagged rows

Where the data stays: The photo goes from LINE through your n8n instance to the model and the row lands in your own sheet; the agent books nothing and files no return, the bookkeeper does that from the sheet.

Design flow

  1. Staff send the receipt photo to the LINE OA
  2. Claude transcribes the fields into fixed JSON
  3. Code checks tax ID, date, VAT and totals
  4. Mismatch? Row flagged needs reviewOnly sometimes
  5. Row added to the sheet, LINE reply to the sender
  6. Bookkeeper checks flagged rows before bookingHuman checkpoint

Setup

Total time: 3 h 5 min our estimate

  1. 45 min

    The README says the packages are not on npm yet: build from source and run the pack script to create local tarballs.

    Done when: The repository builds on Node 22 or newer, the local tarballs exist, the thai-receipt node appears in your n8n, and your Anthropic API key is set as a credential.

  2. 30 min

    Done when: The example workflow is imported, the LINE Messaging credential, the Google Sheets credential and the spreadsheet URL replace the placeholders, and the webhook URL is set on your LINE OA.

  3. 30 min

    Done when: Ten rows land in the Receipts tab, each LINE reply says saved or saved but review, and you have compared every row with its photo.

  4. 20 min

    Done when: It is written down which flags block a booking (tax ID checksum, VAT mismatch) and which only need a glance, and who clears a flagged row.

  5. 1 h

    Done when: You have a count of rows right, flagged correctly and wrong without a flag for one month, because the author says live accuracy is not measured yet.

Ticks are saved on this browser.

Download the kit (zip)

Starter prompt

Written from how the use case works and its sources. Replace the parts in square brackets.

Read this photo of a Thai receipt or tax invoice and return only JSON with these fields: seller_name, seller_tax_id, document_number, date_as_printed, date_iso, line_items (description, quantity, unit_price, amount), subtotal, discount, vat_amount, total, amount_in_words. Transcribe what is printed; do not calculate or correct anything, and use null for a field you cannot read. I will check the tax ID checksum, the Buddhist era date, quantity times price, the 7% VAT and the totals in my own code and flag any mismatch for [the bookkeeper] to review before it is booked.

Risks and data

Data

Receipt photos carry the buyer's and seller's tax IDs and sometimes names and addresses, and they pass through LINE, your n8n instance and the model provider. Limit the LINE OA to staff, keep the sheet with the books, and read the provider's data terms; the author's sample data is synthetic, yours is not.

How it goes wrong

A blurry photo, a thermal receipt that faded, or a handwritten invoice gives a confident but wrong transcription, and the checks catch only what does not add up: a wrong seller name or a wrong date that is still a valid date passes. The author says live accuracy is not measured; you notice when flagged rows pile up or a row disagrees with its photo, so compare every row for the first month and keep the booking decision with the bookkeeper.

Data protection. This use case touches personal data, so check the rules where you operate (for example GDPR, PDPA). A full tax invoice shows the buyer's name, address and tax ID, and a receipt can show the staff member's or a customer's name. The photos and the sheet are personal data under Thailand's PDPA: keep the LINE OA, the n8n instance and the sheet to the people who do the books, and read your model provider's data handling terms before the first upload.

How the agent works

  1. It starts

    Staff send the photo of the receipt or tax invoice to the shop's LINE Official Account.

  2. The agent works

    An n8n workflow catches the message, passes only images on, downloads the file and sends it to Claude with a fixed JSON schema (Claude's structured outputs), so the model only transcribes: seller, date, line items, subtotal, discount, VAT, total, tax ID and the amount in words. Plain code then checks what the model read: the 13 digit tax ID checksum (dashes and Thai digits accepted), the Buddhist era date converted to a normal date, quantity times price, the 7% VAT both inclusive and exclusive, the totals and the amount in words; any mismatch sets a needs review flag with reasons. The workflow appends a row to the Receipts sheet (date, seller, tax ID, document number, subtotal, VAT, total, items, needs review, reasons) and replies on LINE: saved, or saved but please review, with the reasons and the seller, date and total.

  3. The result

    The bookkeeper works from the sheet, opens the flagged rows against the photo, and only then books them or files the tax invoice for the input VAT claim.

Worked example

This is a practitioner build, not a customer story: the open source repository thai-receipt-ai by the Thai developer Yuttakarn (GitHub, MIT licence, all four commits on 20 November 2026, co-authored with Claude). One TypeScript core reads photos and PDFs of Thai receipts and tax invoices with Claude structured output (claude-opus-5-5 by default) and deterministic code checks what the model read: the 13 digit tax ID checksum, Buddhist era dates, quantity times price, the 7% VAT inclusive and exclusive, the totals and the amount in words, with a needs review flag and reasons on any mismatch. It ships as a library, an MCP server with six tools (extract_receipt, check_receipt, validate_tax_id, parse_thai_date, promptpay_qr, baht_text) and an n8n node with an example workflow, LINE receipt photo to Google Sheets: LINE webhook, image check, content download, extract, append a row, reply on LINE with บันทึกใบเสร็จแล้ว or บันทึกแล้ว แต่ควรตรวจสอบ plus the reasons. The README is candid: the eval set is 32 synthetic receipts across 12 fictional shop types with 4 deliberately wrong trap receipts, live model accuracy is not measured yet, a full live run is estimated at USD 1 to 2, and the packages are built from source because they are not on npm yet. No business is named as running it; treat it as a starting point you test on your own receipts.

The extraction library, the MCP server and the n8n node in this build are written on Claude's structured outputs, which Anthropic's docs describe as responses constrained to your JSON schema; the checks are plain code that does not depend on the model. Another model means rewriting the extraction step and the n8n node yourself, so no alternative is listed. The LINE part uses a community LINE Messaging node package for n8n for the webhook, the content download and the reply.

Join the Agent OS Club

Get hours back with a team of AI agents for every department, set up step by step for the tools you use, with a person answering your questions. Founding member price: USD 14.95 a month or USD 150 a year, locked for as long as you stay. Cancel any time.

Founding offer, ends 31 December 2026 or at member 100

Join the Agent OS Club

Building this for an organization? Learn more at theagentiv.com

Sources

Published: 2026-11-22

Related use cases

Cash reconciled in minutes, not an evening

An agent that reconciles each store's cash transactions against the bank deposits every month and hands the owner only the lines that do not match

FinanceEffort: An afternoon
ChatGPTAlso works with:ClaudeGeminiMicrosoft 365 Copilot

An owner with several stores or branches ends every month matching cash transactions from the point of sale against the deposits that actually reached the bank, line by line, store by store. It takes hours, it is easy to miss a short deposit, and it is the kind of job that slips when the month is busy.

Planning ideas flagged on every return

A Copilot agent that evaluates a client's tax return against the firm's planning frameworks and flags opportunities early, plus a quality checkpoint agent that routes work to national tax or estate and trust specialists before it advances, the way a US accounting firm of roughly 1,300 people runs it

FinanceEffort: About a week
Microsoft 365 CopilotAlso works with:ClaudeChatGPT

In a tax practice, planning opportunities are spotted by the people with the most experience, usually late, when the manager finally reviews the file. Junior staff prepare the return without seeing them, the second review by a specialist depends on someone remembering to ask, and there is no record of why a file did or did not get that review.

Catch the auto renewal before it bites

Every vendor contract read by ChatGPT for its key terms, renewal dates and non standard clauses, with a revised version compared against the one you sent so only your changes got in, before legal signs

FinanceEffort: An afternoon
ChatGPTAlso works with:ClaudeGeminiMicrosoft 365 Copilot

A small team signs more vendor agreements than anyone has time to read: software, services, venues, insurance. One person reads every page, flags issues by hand, and still misses the notice window buried deep in the document, so the agreement renews for another year. A revised version comes back from the vendor and nobody can say what changed besides the clause you asked for.