Invoice Chaser — Stop Chasing, Start Getting Paid
You do the work. Your agent gets you paid.
Every freelancer, consultant, and small business owner knows the pain: you did the work, sent the invoice, and now... crickets. Following up is awkward. Waiting kills cash flow. Chasing payments wastes time you could spend on billable work.
Invoice Chaser automates the entire follow-up sequence. It sends reminder emails on schedule, escalates tone from friendly to firm, tracks payment status, logs every interaction, and alerts you when invoices need human attention. Think of it as a persistent, diplomatic collections agent that never forgets and never feels awkward.
What makes it different: This isn't just "send reminder in 7 days." Invoice Chaser runs a full AR pipeline with state management, escalation logic, and tone progression. It knows when to be friendly ("just a heads up"), when to be firm ("payment is 30 days overdue"), and when to alert you for manual escalation. Multi-stage sequences handle the complexity of real-world payment cycles.
Setup
- 1. Run
scripts/setup.sh to initialize config and data directories - Edit
~/.config/invoice-chaser/config.json with email templates, timing, and escalation rules - Ensure
gog skill is installed (for Gmail sending) - Set
GOG_DEFAULT_ACCOUNT in ~/.clawdbot/secrets.env (e.g., your-email@gmail.com) - Test with: INLINECODE6
Config
Config lives at ~/.config/invoice-chaser/config.json. See config.example.json for full schema.
Key sections:
- - business — Your company name, contact info, payment terms
- stages — Email templates for each escalation stage (reminder, overdue, firm, final)
- timing — When to send each stage (days after invoice date or previous stage)
- escalation — Auto-escalation rules, human intervention thresholds
- payment_methods — Include payment links/instructions in reminders
- reporting — Channel, frequency, AR aging groupings
Email templates support variables: {client_name}, {invoice_number}, {amount}, {due_date}, {days_overdue}, {payment_link}.
Scripts
| Script | Purpose |
|---|
| INLINECODE15 | Initialize config and data directories |
| INLINECODE16 |
Add new invoice to tracking system |
|
scripts/chase.sh | Run payment chase cycle (check status, send reminders, escalate) |
|
scripts/status.sh | Show invoice status and AR aging summary |
|
scripts/report.sh | Generate detailed AR aging report |
All scripts support --dry-run for testing without sending emails.
Adding Invoices
CODEBLOCK0
Chase Cycle
Run scripts/chase.sh on schedule (cron daily recommended). The chase cycle:
- 1. Loads all unpaid invoices from tracking database
- Calculates days since invoice date and days overdue (past due date)
- Determines current stage for each invoice based on timing rules
- Sends appropriate reminder emails (stage-based templates with escalating tone)
- Logs all sent emails and stage progressions
- Escalates to human when threshold reached (e.g., 60 days overdue)
- Generates status report
Escalation Stages
CODEBLOCK1
Default timeline:
- - Day 3: Friendly reminder ("Your invoice is due soon...")
- Day 7+: Due date reminder ("Payment was due on [date]...")
- Day 30: First overdue notice ("Your account is now 30 days past due...")
- Day 45: Firm notice ("We must receive payment immediately...")
- Day 60: Final notice ("Final notice before we escalate to collections...")
- Day 75+: Human escalation alert
All timing is configurable in config.json.
Email Tone Progression
Stage 1 — Friendly Reminder (Day 3):
Hi [Client],
Just a friendly reminder that invoice #[number] for $[amount] is due on [due date]. Let me know if you have any questions!
Stage 2 — Professional Overdue (Day 14):
Hi [Client],
I wanted to follow up on invoice #[number] for $[amount], which was due on [due date]. If you've already sent payment, please disregard this message. Otherwise, please let me know if there are any issues preventing payment.
Stage 3 — Firm Notice (Day 30):
Dear [Client],
Your account is now 30 days past due. Invoice #[number] for $[amount] was due on [due date]. Immediate payment is required to avoid service interruption and late fees.
Stage 4 — Final Notice (Day 45):
Dear [Client],
FINAL NOTICE: Invoice #[number] for $[amount] is now 45 days overdue. If we do not receive payment within 7 days, we will be forced to escalate this matter to collections.
All templates fully customizable in config.
Payment Tracking
CODEBLOCK2
AR Aging Report
CODEBLOCK3
Data Files
CODEBLOCK4
Automation
Set up daily chase runs via cron:
CODEBLOCK5
Or use Clawdbot's cron integration:
CODEBLOCK6
Invoice States
CODEBLOCK7
Integration with Accounting
Invoice Chaser tracks payment status. For full accounting integration:
- - Export invoices with
--export flag - Import into QuickBooks, FreshBooks, etc.
- Or build custom adapter (see
references/accounting-adapters.md)
Safety Features
- - Dry-run mode: Test templates without sending emails
- Pause invoices: Stop reminders for clients with special circumstances
- Manual override: Block auto-escalation for sensitive clients
- Email preview: Review email before first send to new client
- Rate limiting: Max emails per day to avoid spam flags
- Unsubscribe handling: Respect opt-outs (manual removal from tracking)
Best Practices
- 1. Be consistent: Run chase cycle daily — consistency trains clients to pay on time
- Personalize templates: Use client names, reference specific work in stage 1-2 emails
- Include payment links: Make it easy to pay (Stripe, PayPal, bank details)
- Escalate gradually: Don't skip stages — tone progression maintains relationships
- Know when to pause: Client communication issues? Pause and follow up manually
- Archive regularly: Move paid invoices to archives monthly to keep DB clean
- Monitor aging: Weekly AR report reveals patterns (chronic late payers, systemic issues)
Example Workflow
Initial setup:
CODEBLOCK8
When you send an invoice:
CODEBLOCK9
Daily automated chase (via cron):
CODEBLOCK10
When payment arrives:
CODEBLOCK11
Weekly review:
CODEBLOCK12
Troubleshooting
Emails not sending:
- - Check
gog skill is installed: INLINECODE26 - Verify
GOG_DEFAULT_ACCOUNT in INLINECODE28 - Test with
--dry-run flag to see email preview
Wrong escalation stage:
- - Check
timing section in config.json - Verify invoice
date and due_date fields - Use
status.sh INV-XXX to see current days calculation
Client keeps getting emails after payment:
- - Run
status.sh INV-XXX --paid to mark as paid - Check
invoices.json to confirm status updated
Philosophy
You did the work. You earned the money. You shouldn't have to beg for it.
Invoice Chaser handles the uncomfortable part of freelancing — following up on unpaid invoices — with persistence and escalating firmness. It preserves your professional relationships by being diplomatic in early stages, but doesn't let clients take advantage of you by being firm when necessary.
Cash flow is the lifeblood of small businesses. Late payments kill businesses. Invoice Chaser keeps the blood flowing so you can focus on what you do best: your actual work.
Stop chasing payments. Your agent sends the awkward emails so you don't have to.
发票追款助手 — 停止追讨,开始收款
你完成工作。你的智能代理帮你收款。
每一位自由职业者、顾问和小企业主都深知这种痛苦:你完成了工作,发出了发票,然后……石沉大海。跟进催款令人尴尬。等待付款扼杀现金流。追讨欠款浪费了你本可用于计费工作的时间。
发票追款助手自动化了整个跟进流程。它按计划发送提醒邮件,语气从友好逐步升级到强硬,追踪付款状态,记录每一次互动,并在发票需要人工处理时提醒你。把它想象成一个永不遗忘、永不尴尬的、坚持不懈且得体的催收代理。
与众不同之处: 这不仅仅是7天后发送提醒。发票追款助手运行一个完整的应收账款流程,包含状态管理、升级逻辑和语气递进。它知道何时该友好(只是提醒一下),何时该强硬(付款已逾期30天),以及何时需要提醒你进行人工升级。多阶段流程处理现实世界中复杂的付款周期。
设置
- 1. 运行 scripts/setup.sh 初始化配置和数据目录
- 编辑 ~/.config/invoice-chaser/config.json,配置邮件模板、时间安排和升级规则
- 确保已安装 gog 技能(用于Gmail发送)
- 在 ~/.clawdbot/secrets.env 中设置 GOGDEFAULTACCOUNT(例如 your-email@gmail.com)
- 使用以下命令测试:scripts/add-invoice.sh --test
配置
配置文件位于 ~/.config/invoice-chaser/config.json。完整模式参见 config.example.json。
关键部分:
- - business — 你的公司名称、联系信息、付款条款
- stages — 每个升级阶段的邮件模板(提醒、逾期、强硬、最终)
- timing — 每个阶段的发送时间(发票日期或上一阶段后的天数)
- escalation — 自动升级规则、人工干预阈值
- payment_methods — 在提醒中包含付款链接/说明
- reporting — 报告渠道、频率、应收账款账龄分组
邮件模板支持变量:{clientname}、{invoicenumber}、{amount}、{duedate}、{daysoverdue}、{payment_link}。
脚本
| 脚本 | 用途 |
|---|
| scripts/setup.sh | 初始化配置和数据目录 |
| scripts/add-invoice.sh |
向追踪系统添加新发票 |
| scripts/chase.sh | 运行付款催收周期(检查状态、发送提醒、升级) |
| scripts/status.sh | 显示发票状态和应收账款账龄摘要 |
| scripts/report.sh | 生成详细的应收账款账龄报告 |
所有脚本均支持 --dry-run 参数用于测试,不会实际发送邮件。
添加发票
bash
手动添加发票
scripts/add-invoice.sh \
--number INV-2025-042 \
--client Acme Corp \
--email billing@acme.com \
--amount 2500.00 \
--date 2025-01-15 \
--due 2025-02-14 \
--net 30
快速添加(假设净30天条款)
scripts/add-invoice.sh --number INV-042 --client Acme Corp --email billing@acme.com --amount 2500
标记为已付款
scripts/status.sh INV-042 --paid --date 2025-02-10
催收周期
按计划运行 scripts/chase.sh(建议每日通过cron运行)。催收周期:
- 1. 从追踪数据库加载所有未付款发票
- 计算自发票日期起的天数和逾期天数(超过到期日)
- 根据时间规则确定每张发票的当前阶段
- 发送相应的提醒邮件(基于阶段模板,语气逐步升级)
- 记录所有已发送邮件和阶段进展
- 达到阈值时升级到人工处理(例如逾期60天)
- 生成状态报告
升级阶段
已发送 → 提醒(友好)→ 逾期(专业)→ 强硬(坚持)→ 最终(紧急)→ 已升级
↓ ↓ 第3天 ↓ 第7天+ ↓ 第30天 ↓ 第45天 ↓ 第60天
已付款(随时)✅
默认时间线:
- - 第3天:友好提醒(您的发票即将到期……)
- 第7天+:到期日提醒(付款应于[日期]支付……)
- 第30天:首次逾期通知(您的账户现已逾期30天……)
- 第45天:强硬通知(我们必须立即收到付款……)
- 第60天:最终通知(在我们将此事升级至催收部门前的最终通知……)
- 第75天+:人工升级提醒
所有时间安排均可在 config.json 中配置。
邮件语气递进
阶段 1 — 友好提醒(第3天):
您好 [客户],
只是友好提醒一下,发票 #[编号] 金额 $[金额] 将于 [到期日] 到期。如有任何疑问,请随时告知!
阶段 2 — 专业逾期通知(第14天):
您好 [客户],
我想跟进一下发票 #[编号] 金额 $[金额],该发票已于 [到期日] 到期。如果您已付款,请忽略此消息。否则,请告知是否存在任何阻碍付款的问题。
阶段 3 — 强硬通知(第30天):
尊敬的 [客户],
您的账户现已逾期30天。发票 #[编号] 金额 $[金额] 应于 [到期日] 支付。为避免服务中断和滞纳金,请立即付款。
阶段 4 — 最终通知(第45天):
尊敬的 [客户],
最终通知:发票 #[编号] 金额 $[金额] 现已逾期45天。如果在7天内未收到付款,我们将被迫将此事项升级至催收部门。
所有模板均可在配置中完全自定义。
付款追踪
bash
标记发票为已付款
status.sh INV-042 --paid --date 2025-02-10
添加付款备注
status.sh INV-042 --note 客户来电,已通过支票付款
暂停提醒(客户要求延期)
status.sh INV-042 --pause --until 2025-03-01
归档但不付款(核销)
status.sh INV-042 --archive --reason 坏账核销
应收账款账龄报告
bash
显示摘要
scripts/report.sh
输出:
📊 应收账款账龄报告
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
当前(0-30天): $12,500 (5张发票)
31-60天: $3,200 (2张发票)⚠️
61-90天: $1,800 (1张发票)🚨
90天以上: $500 (1张发票)💀
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
未结总额: $18,000 (9张发票)
详细视图
scripts/report.sh --detail
导出为CSV
scripts/report.sh --export ar-aging-2025-01-28.csv
数据文件
~/.config/invoice-chaser/
├── config.json # 用户配置
├── invoices.json # 发票数据库(状态机)
├── chase-log.json # 邮件发送历史
├── last-chase-report.json # 最近一次催收运行数据
└── archives/
└── YYYY-MM/ # 已归档的已付款/核销发票
自动化
通过cron设置每日催收运行:
bash
每天早上9点运行
0 9
* cd ~/clawd/skills/invoice-chaser && scripts/chase.sh >> ~/.config/invoice-chaser/chase.log 2>&1
每周一向Telegram发送应收账款报告(周一早上8点)
0 8
1 cd ~/clawd/skills/invoice-chaser && scripts/report.sh --channel telegram
或使用Clawdbot的cron集成:
bash
clawdbot cron add \
--schedule 0 9 * \
--command cd ~/clawd/skills/invoice-chaser && scripts/chase.sh \
--label invoice-chaser-daily
发票状态
草稿