Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Files & Cloud Storage

Files & Cloud Storage

Capture LINE receipt expenses with Gemini, Google Drive and Google Sheets

When an API call/webhook arrives, it manages files with Google Gemini using Google Drive, Google Sheets.

What it does

## Capture LINE Receipt Expenses with Gemini and Verify Japanese Invoice Numbers Users send receipt images to a LINE official account. The workflow archives each image in Google Drive, extracts structured expense data with Gemini, checks Japanese Qualified Invoice Numbers against the National Tax Agency (NTA) Web-API for the receipt date, records valid expenses in Google Sheets, and replies in LINE. Non-image messages and invalid receipts receive guidance instead of being logged. Who's it for: finance teams, field sales staff, and Japanese businesses that want mobile receipt capture with invoice-status verification. ### How it works 1. A LINE webhook receives the message and extracts the message type, ID, reply token, and user ID. 2. Non-image messages receive instructions for sending a receipt photo. 3. Image messages are downloaded, archived in Google Drive, and converted to Base64. 4. Gemini determines whether the image is a receipt and extracts the date, vendor, totals, category, description, and T-number. 5. Invalid receipt images receive a retry message and are not added to the ledger. 6. If a valid T-number is found, the NTA validity endpoint checks its status on the receipt date. 7. The completed expense record is appended to Google Sheets and confirmed in LINE. ### Setup 1. Configure the LINE webhook and Channel Access Token header credentials for all LINE HTTP Request nodes. 2. Configure a Gemini API-key header credential. 3. Connect Google Drive and replace YOUR_DRIVE_FOLDER_ID with the archive folder. 4. Connect Google Sheets and replace the spreadsheet and sheet placeholders. Create the columns listed in the Google Sheets node. 5. Replace YOUR_NTA_APP_ID with your NTA Web-API application ID and add the production webhook URL in LINE Developers. ### Customization tips - Adjust the Gemini categories, Google Sheets schema, or Japanese LINE messages to match your expense policy.

The steps

  1. When LINE Webhook Triggered
  2. Set LINE Message Data
  3. If LINE Message is Image
  4. Fetch LINE Image Content
  5. Store Receipt in Google Drive
  6. Convert Image to Base64
  7. Submit to Gemini for Analysis
  8. Extract Receipt Details
  9. Check for Invoice Number
  10. Verify Invoice via NTA API
  11. Build Valid Record
  12. Append Expense to Sheets
  13. Post Expense Receipt to LINE
  14. Reply with Text Guide

17 steps in total.

Similar automations