Send an invoice via Telegram — PDF or photo — and this pipeline handles the rest. It extracts every detail: supplier name, invoice number, dates, line items with quantities and prices, tax, and totals. Then it organizes the file in Google Drive and logs everything to Google Sheets.
No more manual data entry. No more copy-pasting from receipts. Just forward the invoice to a Telegram bot and get a confirmation message with the parsed summary within seconds. Supports both digital PDFs and photographed paper invoices.
The user sends an invoice to a Telegram bot — either as a PDF document or a photo. The workflow triggers automatically, downloads the file, and routes it to the appropriate extractor based on file type.
PDFs go through text extraction first, then Gemini parses the structured data. Images are sent directly to Gemini's vision model with a detailed schema — supplier name, invoice number, date, currency, line items (description, quantity, price, total), subtotal, tax, and grand total. A structured output parser ensures consistent formatting.
The original invoice file is uploaded to Google Drive, automatically organized into year/month folders. If the folders don't exist yet, they're created on the fly. The filename includes the supplier and invoice number for easy searching.
All extracted fields are appended to a Google Sheet — creating a running ledger of every invoice processed. The user gets a Telegram confirmation with the parsed summary, or an error message if something couldn't be read.
Handles both digital PDF invoices and photographed paper receipts. The pipeline detects the file type and routes it to the right extraction method — text parsing for PDFs, vision AI for images.
Designed to handle invoices with mixed languages — Chinese and English. Line item descriptions preserve both language versions so nothing gets lost in translation.
Files are automatically sorted into year/month folder structures in Google Drive. No manual filing — the system builds the folder tree as needed and names files consistently.
Every invoice gets logged to Google Sheets with all extracted fields — creating a searchable, filterable record of all expenses. Ready for accounting, reporting, or reconciliation.