How to Automate Your Expense Tracking with OpenClaw and Telegram
How to Automate Your Expense Tracking with OpenClaw and Telegram
You just bought lunch. You have the receipt. You know you should log it somewhere. You won’t.
This is the expense tracking problem: the gap between “I should track this” and “I actually did” is enormous. Apps don’t fix it because apps require effort. What fixes it is removing effort entirely.
Here’s the setup: drop a photo of any receipt into a Telegram channel. OpenClaw picks it up, extracts the data, categorizes the expense, and logs it to a spreadsheet. No apps to open. No forms to fill. Just snap and send.
Let’s build it.
Why Telegram + OpenClaw
Telegram is already on your phone. It supports channels, bots, and media uploads natively. OpenClaw’s cron system can poll a Telegram channel on a schedule, process new messages, and take action — all without you touching a keyboard.
The combination works because it meets you where you already are. You’re not learning a new tool. You’re texting a channel.
The Architecture
The system has three parts:
- A dedicated Telegram channel — your receipt inbox
- An OpenClaw cron job — polls the channel every 15 minutes
- A processing pipeline — extracts receipt data, categorizes it, appends to a Google Sheet or CSV
When a new image lands in the channel, OpenClaw’s vision capabilities read the receipt, pull out the vendor name, amount, date, and category, then write a clean row to your expense log. Text messages work too — just type “Coffee $4.50” and it parses that.
Step 1: Set Up the Telegram Channel
Create a private Telegram channel. Call it something like “Expenses” or “Receipts.” Add your Telegram bot (the one connected to OpenClaw) as an admin so it can read messages.
If you haven’t connected Telegram to OpenClaw yet, the setup takes about five minutes. You need a bot token from BotFather and the channel plugin configured in your OpenClaw gateway config.
Step 2: Create the Expense Schema
Before OpenClaw can log expenses, it needs to know the format. Create a simple schema file:
{
"columns": ["date", "vendor", "amount", "category", "notes"],
"categories": [
"Food & Dining",
"Transportation",
"Software & Subscriptions",
"Office Supplies",
"Travel",
"Utilities",
"Miscellaneous"
],
"output": "/path/to/expenses.csv"
}
Store this in your OpenClaw workspace. The agent will reference it when processing each receipt.
Step 3: Build the Cron Job
This is where it comes together. Set up an OpenClaw cron job that runs every 15 minutes:
name: "Expense Tracker"
schedule:
kind: cron
expr: "*/15 * * * *"
sessionTarget: isolated
payload:
kind: agentTurn
message: >
Check the Expenses Telegram channel for new receipt images
or text messages since the last check. For each new message,
extract the expense details (date, vendor, amount, category)
and append them to the expense log CSV. Use vision to parse
receipt images. Categorize automatically based on the vendor.
The agent handles the intelligence layer. It sees a photo of a Starbucks receipt and knows that’s “Food & Dining, $5.75, Starbucks.” It sees a text message saying “Uber to airport $34” and logs “Transportation, $34.00, Uber.”
Step 4: Add Smart Categorization
OpenClaw’s language understanding means categorization happens naturally. But you can improve accuracy by giving it examples in your schema:
{
"category_hints": {
"Starbucks": "Food & Dining",
"Uber": "Transportation",
"AWS": "Software & Subscriptions",
"Notion": "Software & Subscriptions",
"Delta": "Travel"
}
}
The agent uses these as anchors but can categorize novel vendors on its own. Over time, you can add more hints as you see how it categorizes things.
Step 5: Weekly Summary Reports
One cron job for logging. Another for reporting. Set up a weekly cron that runs every Monday morning:
name: "Weekly Expense Summary"
schedule:
kind: cron
expr: "0 9 * * 1"
sessionTarget: isolated
payload:
kind: agentTurn
message: >
Read the expense log CSV. Generate a weekly summary:
total spending, breakdown by category, top vendors,
and comparison to last week. Send the summary to
the Expenses Telegram channel.
Now every Monday you wake up to a clean spending report. No spreadsheet wrangling. No pivot tables. Just the numbers.
What Makes This Better Than Expense Apps
Most expense tracking apps fail for the same reason most habit apps fail: they add friction to an already annoying task. You have to open the app, find the right screen, enter the data, pick a category, and save.
This system has one step: send a photo. That’s it. The rest is automated.
It’s also completely private. Your receipt data lives on your own infrastructure — your OpenClaw instance, your CSV or Google Sheet. No third-party expense app is mining your purchase history.
And it’s extensible. Want to flag expenses over $100? Add a rule. Want to auto-generate tax-ready reports at year-end? Add another cron job. Want to split expenses between business and personal? Add a second channel.
Advanced: Multi-Currency and Reimbursement Tagging
If you travel or work with international clients, add currency detection to your schema. OpenClaw can read the currency symbol on a receipt and convert amounts using current exchange rates.
For reimbursable expenses, just add a tag. Send the receipt photo with the caption “reimbursable” and the agent flags that column. At the end of the month, filter for reimbursable items and generate an invoice.
The Bigger Picture
Expense tracking is a small problem. But it’s a perfect example of what agent automation actually looks like in daily life. It’s not about replacing your job or building a SaaS. It’s about eliminating the tedious stuff that drains your time and attention.
Every receipt you manually log is a context switch. Every context switch costs you more than the two minutes it takes. By removing that friction, you’re not just saving time — you’re preserving focus for work that actually matters.
That’s the real value of self-hosted AI agents. Not the flashy demos. The quiet automations that make your day 2% better, compounding over months and years.
Get Started
If you’re running OpenClaw, you can build this in under an hour. If you’re not running OpenClaw yet, this is a solid reason to start. Check out our beginner’s guide to get set up, then come back here and build your first real automation.
Your receipts are waiting.
MarketMai helps you build smarter with AI automation. New posts daily.
More from the build log
Suggested
Want the full MarketMai stack?
Get all 7 digital products in one premium bundle for $49.
View Bundle