The AgentivUse cases

Finance · About a week · Thailand

Send a slip in LINE, the expense books itself

A LINE expense bot that reads a payment slip photo with Gemini, proposes the amount, date, payee and reference number, and saves the expense only after the user taps confirm and picks the category and project, built by a Thai limited partnership into its own bookkeeping system

The problem

A Thai small business pays suppliers and site expenses by bank transfer, and the slips pile up in LINE chats until someone keys the amounts into the books at month end. Typing from a slip is slow and error prone: a wrong digit, a Buddhist Era date read as a Western one, the same transfer entered twice, or the expense booked against the wrong project.

Architecture

  1. Channel
    • LINE expense bot
    • Slip photo in the chat
  2. Agent
    • Gemini reads the slip
    • Field checks in code
  3. Tools
    • Supabase expense records
    • Model key in Supabase Vault
  4. Human
    • Staff confirm the amount
    • Staff pick category, project

Where the data stays: Slip photos and expenses stay in your own Supabase; a compressed copy of each slip goes to the model provider to be read.

Design flow

  1. Staff send a slip photo to the LINE bot
  2. Gemini reads amount, date, payee, reference
  3. Code checks each field, converts the BE year
  4. Reference saved before: duplicate warningOnly sometimes
  5. Staff confirm, pick category, press saveHuman checkpoint

Setup

Total time: 4 h 10 min our estimate

  1. 20 min

    The free tier has a daily quota and its terms may let Google use the images, names and account numbers included: for real supplier slips use a paid tier, check in your plan.

    Done when: The settings card shows the slip reader as on with only the key's last four characters, and the test button answers that the key works.

  2. 1 h 30 min

    Done when: A real transfer slip sent to the bot comes back with amount, date, payee and reference, and a confirm button showing the amount read.

  3. 1 h

    Done when: Unit tests pass for a zero amount, a Buddhist Era date, a future date, a date older than 400 days and a reference with odd characters.

  4. 30 min

    Done when: Sending the same slip again after saving shows a duplicate warning, and staff can still save if it is a real second payment.

  5. 30 min

    Done when: Nothing is saved until staff confirm or retype the amount, pick category and project and press save; a project named in the slip note is first among the buttons, not selected.

  6. 20 min

    Done when: With the key cleared, the quota used up or a photo that is not a slip, the bot asks for the amount by hand and says why.

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.

You read Thai bank transfer slips for an expense bot. From the attached slip image return only a JSON object with amount (number, Thai baht), date (YYYY-MM-DD, convert a Buddhist Era year by subtracting 543), payee (the recipient name as printed) and reference (the transaction reference, letters, digits, underscores and hyphens only). If a field is not readable, return null for it and never guess. Do not add any other text. The user will confirm or correct the amount and choose the category and project before anything is saved.

Risks and data

Data

A slip shows the payee's name and often a masked account number, which is personal data when the supplier is a sole trader. Keep the model key in the vault, limit the bot to staff accounts, and read the model's data terms first: the source's own settings card warns that Google's free tier may use submitted images, including names and account numbers.

How it goes wrong

One digit read wrong becomes a wrong cost that nobody notices. The confirm button shows the amount read so staff compare it with the slip, the parser drops impossible amounts and dates, and the duplicate warning catches a slip sent twice. When the quota runs out the bot quietly falls back to typing, so watch how many slips are keyed by hand each month.

Data protection. This use case touches personal data, so check the rules where you operate (for example GDPR, PDPA). A transfer slip shows the payee's name and often a masked account number, and for a sole trader supplier that is personal data under Thailand's PDPA. Keep the model key in a vault as the source does, limit the bot to staff accounts, and before sending slips to a free model tier read its data terms: the source's own settings card warns that Google may use submitted images to improve its services, so a paid tier with data processing terms, or Claude or OpenAI under their business terms, is the safer choice for real supplier data.

How the agent works

  1. It starts

    Staff key expenses through the company's LINE bot.

  2. The agent works

    When a user sends a slip photo, the bot stores the photo and, if no amount was typed, sends a compressed copy of the image to Gemini, which returns the amount, date, payee and reference number. That result is a proposal, not an entry: the bot shows a confirm button with the amount it read, or the user types a different amount. A parsing step checks every field before it is shown, so the amount must be above zero and within a ceiling, a Buddhist Era year is converted, a date in the future or older than 400 days is dropped, and the reference may contain only letters, digits, underscores and hyphens. If that reference was already saved, the bot warns but does not block. The user then picks the category and the project (a project named in the slip's note is placed first among the buttons, never selected for them) and presses save; nothing is saved without that press. If the key is missing, the free quota is used up, the key is invalid or the slip cannot be read, the bot falls back to asking for the amount by hand and says why.

  3. The result

    The Gemini key sits in Supabase Vault and is managed on a settings card with save, test and off.

Worked example

ห้างหุ้นส่วนจำกัด รวยแน่ (Ruaynae Limited Partnership) runs its own income and expense recording system, whose login page names the partnership and asks for a project head, an owner, an email and a PIN. Its public GitHub repository merged the slip reading feature, labelled R24, on 31 October 2026 (pull request 44, 'read slips with AI in the expense entry bot'). The pull request names gemini-3.5-flash-lite with gemini-flash-lite-latest as the fallback, a seven case unit test suite for the parser, a test plan covering unit tests, database checks, the settings card and the LINE scenarios, and a settings card that warns the user that Google may use submitted images to improve its services. The source reports no time saved or error counts, so measure your own: slips keyed by hand per month before and after, and corrections found at month end.

The slip reading is one vision model call, so Claude or an OpenAI model can take Gemini's place in a build like this. The LINE bot, the field checks, the duplicate warning and the confirmation card are the company's own code and come with no vendor; the source used Gemini's free tier, which is why the bot has a fallback for an exhausted quota.

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-03

Related use cases

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

FinanceEffort: An afternoonThailand
Clauden8nLINE+1

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.

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.