Blog · August 15, 2026 · 8 min read

How to Build an AI Agent That Chases Overdue Invoices

A Hermes agent that reads QuickBooks weekly, finds overdue invoices, emails and texts a Stripe payment link, logs replies, and checks back. Full setup.

Watch the video: I Built a Hermes AI Agent That Manages Invoices — Full Setup

Most small businesses do not have an invoicing problem. They have a follow-up problem. The invoice is sitting in QuickBooks, it is overdue, and the owner is too busy doing the actual work to keep chasing it. You can fix that with a Hermes agent that checks QuickBooks every week, finds the invoices that are genuinely overdue, verifies the balance, then emails and texts the customer a secure Stripe payment link. When the customer replies "I'll pay Friday," the agent logs it and checks back.

This is a long build, so I put together a step-by-step document, linked in the video description, and you should watch the full walkthrough alongside it. Here is the whole flow.

What the invoice follow-up agent does

The example is a painting company with a pile of overdue invoices eating its cash flow. The owner does not have time to finish projects and chase payments. So the agent does the chasing, on two fronts at once:

  • It emails the customer with a payment link.
  • It texts the customer with the same link.

Hitting both raises the chance of getting paid. When the customer responds, one of two things happens. They pay through the Stripe link and the business gets its money. Or they promise a date, and the agent records the promise in a tracker and checks that day or the day after to confirm the payment came through.

You run it on a schedule: weekly, every two weeks, monthly. It suits a solo owner with no admin, which is most of the small businesses I work with.

What you need before you start

  • A Google account for Gmail, Google Drive, Docs and Sheets.
  • QuickBooks Online. For a real client you log into their QuickBooks. To test, the 30-day trial is enough.
  • A Stripe account for payment links.
  • An AgentCall account for the phone number that sends texts.
  • A Composio account, which connects the agent to QuickBooks, Stripe, Gmail and Sheets.
  • A Hermes agent running 24/7. Mine runs on a Hostinger VPS. If you are still deciding how to host, this guide covers the options.

Step 1: give the agent a phone number with AgentCall

The agent needs a number to text from.

  1. Go to agentcall.co, sign in, and create an API key. I named mine "invoice agent". You get a free key to test with. AgentCall is my own product, so I know the flow well.
  2. Copy the key into your Hermes environment. On Hostinger: VPS, Manage, open the Docker manager, Manage on the Hermes container, scroll to Environment, add a variable named AGENTCALL_API_KEY with the key as the value.
  3. Scroll to the top and click Deploy. After a few seconds Hermes can use AgentCall.

Step 2: set up Stripe

Create a Stripe account at stripe.com, or use the client's. That is all. You do not need a Stripe API key here, because Composio handles the connection.

Step 3: create a test invoice in QuickBooks

You cannot test an invoice agent without an overdue invoice.

  1. In QuickBooks Online, click the plus button, then Invoice.
  2. Click Add new for the customer. Use a made-up name, but your own email and phone number, so the agent's messages reach you.
  3. Add a line for the service. Mine was painting a two-bedroom, $2,000.
  4. Set the terms to due on receipt, and set the invoice date and due date in the past. That is what makes the agent see it as overdue.
  5. Save.

Step 4: connect everything through Composio

Composio connects your agent to over a thousand apps.

  1. Go to composio.dev, log in, and create an API key (select "read all"). Add it to your Hermes environment as COMPOSIO_API_KEY, the same way as the AgentCall key, and deploy.
  2. Go to Toolkits and add QuickBooks. Click Add project. Give the configuration a name that ties it to this automation. Mine is "invoicing agent". Keep the same name for every tool you add for this build; Composio lets you keep separate setups for different clients or different jobs. Leave authentication managed by Composio, create it, then click Connect account and log into QuickBooks when prompted.
  3. Repeat for Stripe, with the same configuration name.
  4. Repeat for Google Sheets, choosing the Google account you want to use.
  5. Repeat for Gmail, with the same Google account. Composio also offers Outlook and Zoho if you prefer.

Step 5: prompt the agent in Telegram

Now switch to Telegram and work through the prompts in the document, in order.

  1. Build a tool router. This tells Hermes which apps Composio has access to. You need a new router every time you add an app. Mine came back as a finance tool router for the painting company with QuickBooks, Stripe, Gmail, Google Sheets, Calendar and Drive all active.
  2. Create the tracker. A one-time prompt that creates a private Google Sheet called "Hermes invoice follow-up tracker" with the columns the agent will fill in. Sheets is free; a client with a CRM such as HubSpot could use that instead.
  3. Give the agent its role. A detailed prompt: you are the overdue invoice follow-up agent for this business, you use QuickBooks Online, Google Sheets, Gmail and AgentCall, in this time zone, with these payment links. It includes non-negotiables, such as never collecting card or bank details over SMS, and treating a STOP, cancel or unsubscribe reply as permanent. Those matter legally.
  4. Tell it how to report to the owner. The owner will not open the spreadsheet. They want to ask the agent: how many invoices did you scan, how many are overdue, how many are waiting for my approval, who replied.
  5. Create the schedule. A cron prompt: weekly, at a set time in the business's time zone. Adjust to the client.
  6. Set the customer communication rules. How the emails and texts should read, what the payment link looks like, and how to report back.
  7. Test everything. Paste the testing prompt and have the agent confirm each piece: can it see the invoice, what is the amount, can it send the email.

Step 6: provision the number and run it

Ask the agent: "Provision a new phone number with AgentCall for my invoicing agent so I can send an SMS to my clients." It returns the number, a label, the local area code, the cost and the number ID. Save the ID.

New numbers take about two hours to be registered before they can deliver texts. Every carrier does this to prevent spam. If you are setting this up for a client, provision the number a day or two before you need it.

Then run the real thing. I asked: "Check our QuickBooks and tell me what outstanding invoices we have." It came back with three unpaid invoices, including the $2,000 one from the test customer, six days overdue, and a $4,000 one, three days overdue.

I asked it to send an SMS and an email with a Stripe payment link to the $4,000 customer, whose contact details were mine. A few minutes later I had a text with a Stripe link, and an email with the same link. Both opened a Stripe page showing the $4,000 owed under the customer's name.

I replied to the text: "I will pay this on tomorrow on Friday," deliberately worded badly. The agent answered, "Okay, sounds good. Tomorrow works." In the tracker, the last-customer-reply column now held my exact message, next to the invoice number, balance, due date, days overdue, when the contact was made, and the payment link.

With the cron job running, the agent checks each morning: who promised to pay, did the Stripe payment come through, and who needs another reminder.

What this means for your business

  • Cash flow without the chasing. The agent becomes the bill collector. The owner sees a summary and approves, rather than writing reminder emails at night.
  • Two channels, one link. Email and text with the same secure Stripe link. Customers pay from their phone.
  • A log you can trust. Every contact and every reply is in the sheet, with dates. Disputes like "I already paid this" become easy to check.
  • A service you can sell. If you set up agents for clients, this is the kind of boring, repeatable automation a business owner will pay for. Each client gets its own Composio configuration and its own number.

The one rule: check in on it now and then. Agents make mistakes, and a quick look at the tracker each week keeps it honest. For more jobs an agent can take on, see the six use cases and the Gmail setup that many of them build on.

If you want this running for your business without doing the setup yourself, get in touch and tell me how many invoices you are chasing.

FAQ

What tools does the invoice follow-up agent use?

Hermes Agent, QuickBooks Online, Stripe, Gmail, Google Sheets, AgentCall for texting, and Composio to connect them all. The agent runs 24/7 on a VPS.

Does the agent need my Stripe API key?

No. Stripe is connected through Composio's authentication, so the agent creates payment links without you handling a Stripe key.

Why does the phone number take two hours to work?

Carriers register new numbers before allowing SMS delivery, which prevents spam. Provision the number a day or two before you need it.

What happens when a customer replies to the text?

The agent responds, records the reply in the Google Sheets tracker, and on its next scheduled run checks whether the promised payment came through in Stripe.

Can I use a CRM instead of Google Sheets?

Yes. Sheets is used because it is free. A client with HubSpot or another CRM can have the agent log activity there instead.

More guides · Video tutorials · Work with Percy