The moment it happens
Turn receipt photos into rows in your expense sheet
Send a photo of a receipt to your Telegram bot and the merchant, date, total and category land in your expenses sheet.
- Runs
- The moment it happens
- Apps
- Google Sheets, Telegram
- AI
- Yes, uses the built-in AI allowance
- Access
- Telegram bot token; Sheets read+write
Send this to your assistant
Create a ClickRuntime automation: when I send a receipt photo to my Telegram bot, read the merchant, date, total and category, add a row to my Expenses sheet and reply to confirm.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A consultant who travels for clients collects taxis, lunches and hotel receipts all month, then spends an evening typing them into a spreadsheet before invoicing. Paper receipts fade or go missing, and anything not logged on the day is often never claimed.
Sending a photo straight after paying takes a few seconds. The details are read from the image and written to your sheet while the receipt is still in your hand, so month-end becomes a review instead of a data-entry session.
What you get out of it
Expenses logged on the day
The receipt is recorded the moment you pay, not weeks later. Fewer receipts are lost, so fewer costs go unclaimed.
No typing totals by hand
Merchant, date and amount are read from the photo. You check the confirmation instead of copying numbers, which cuts typos in your claims.
Categories ready for reporting
Each row gets a category such as travel or meals. Filtering the sheet for a client or a tax return takes minutes.
Works from your phone anywhere
Telegram is already on your phone, so there is no extra app to open. It works the same in a taxi, an airport or a client office.
A confirmation you can trust
The bot replies with what it recorded. If the total looks wrong you see it straight away and can fix the row.
How it works
What happens, step by step
You send a photo of a receipt to your Telegram bot.
ClickRuntime fetches the image and an AI vision service reads the merchant, date, total and category from it.
A new row with those details is added to the Expenses tab of your Google Sheet.
The bot replies with what it recorded so you can check it at a glance.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect Telegram
- Paste your automation's link into the other app's webhook settings
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Slack
- Combine it with other Google Sheets and Telegram steps into one automation
Under the hood
The code that runs this automation
import base64, json
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, http
SHEET_ID = "your-spreadsheet-id"
@on_event
def handle(event):
msg = (event.json or {}).get("message") or {}
if not msg.get("photo"):
return {"skipped": "no photo"}
token = credentials.secret("TELEGRAM_BOT_TOKEN")
api = f"https://api.telegram.org/bot{token}"
path = http.get(f"{api}/getFile", params={"file_id": msg["photo"][-1]["file_id"]}).json()["result"]["file_path"]
image = base64.b64encode(http.get(f"https://api.telegram.org/file/bot{token}/{path}").content).decode()
resp = http.post("https://api.openai.com/v1/chat/completions", headers={"Authorization": f"Bearer {credentials.secret('OPENAI_API_KEY')}"},
json={"model": "gpt-4o-mini", "response_format": {"type": "json_object"}, "messages": [{"role": "user", "content": [
{"type": "text", "text": "Return JSON with merchant, date, total and category from this receipt."},
{"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{image}"}}]}]})
if not resp.ok:
http.post(f"{api}/sendMessage", json={"chat_id": msg["chat"]["id"], "text": "Could not read that receipt, please try again."})
return {"added": 0}
r = json.loads(resp.json()["choices"][0]["message"]["content"])
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
sheets.spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Expenses!A:E", valueInputOption="USER_ENTERED",
body={"values": [[r.get("date"), r.get("merchant"), r.get("total"), r.get("category"), msg.get("caption", "")]]}).execute()
http.post(f"{api}/sendMessage", json={"chat_id": msg["chat"]["id"], "text": f"Added {r.get('merchant')} {r.get('total')} ({r.get('category')})"})
return {"added": 1}FAQ
Common questions
What if the photo is blurry or the total cannot be read?
Can I add a note, such as the client name?
Does it handle receipts in other currencies?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Turn Telegram ideas into short videos logged in a sheet
Message your bot an idea and get back a finished short video, with every video tracked in your Google Sheet.
See how it worksAnswer Telegram questions from a Google Sheet
People message your Telegram bot and get answers drawn from your sheet, with every question and reply logged.
See how it worksLog meals and macros by messaging a Telegram bot
Tell your bot what you ate and get calories and macros logged in your sheet, with today's total in the reply.
See how it worksKeep exploring
Set up “Turn receipt photos into rows in your expense sheet” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.