What the agent does
This is for a bookkeeping or accounting firm that keeps the books for small businesses and chases their receivables. The run has no repository. It names one connection: the client's QuickBooks Online company, connected once with POST /me/connections {"type": "app", "name": "quickbooks"}. The authorize_url opens Intuit's sign-in, where the person picks the company, and Rush stores the connection under that company's realm id. The agent reaches the QuickBooks Online Accounting API for that company only, with the com.intuit.quickbooks.accounting scope, and Rush signs each call outside the sandbox, so the token never enters it.
The agent starts with the invoices that still have money owing. It sends SELECT * FROM Invoice WHERE Balance > '0' to the Accounting API's query endpoint, paging until it has them all, and keeps the ones whose DueDate is before today. For each it records DocNumber, the customer from CustomerRef, TxnDate, DueDate, TotalAmt, Balance and BillEmail, and works out the days overdue. An invoice whose Balance is less than its TotalAmt is marked partly paid, because a reminder for the full amount on a part-paid invoice is the fastest way to annoy a good customer.
Then it sorts the list into the buckets an aging report uses: 1 to 30 days, 31 to 60, 61 to 90 and over 90, and totals each customer across their invoices. It also looks at EmailStatus. An overdue invoice whose status is NotSet or NeedToSend was never emailed from QuickBooks, so it is listed apart: that customer may not know the invoice exists, and the right next step is sending the invoice, not a reminder. Invoices with no BillEmail are listed apart too, since there is no address to draft to.
Last, it drafts one reminder per customer, not per invoice. Each draft is addressed to the invoice's BillEmail, lists every overdue invoice for that customer with its number, date, due date and balance, and gets firmer with age: a friendly note for the first bucket, a request for a payment date past 30 days, and a note that the firm will call past 60. It writes overdue.csv and reminders.md, and calls nothing in QuickBooks that sends, voids or changes a record.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Use the QuickBooks connection. Query every Invoice with Balance > '0' and keep those whose DueDate is before today. Write overdue.csv with one row per invoice: customer, DocNumber, TxnDate, DueDate, TotalAmt, Balance, days overdue, aging bucket (1-30, 31-60, 61-90, 90+), BillEmail, EmailStatus, and partly_paid (Balance < TotalAmt). Write reminders.md with one draft email per customer covering all their overdue invoices, addressed to BillEmail, polite under 30 days, asking for a payment date from 31 to 60, and saying we will call over 60. List separately any overdue invoice with EmailStatus NotSet or NeedToSend, and any with no BillEmail. Read only: send, void and change nothing in QuickBooks.",
"connections": [
"quickbooks"
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
The session has two artifacts. overdue.csv is the aging list, one row per overdue invoice, ready to sort or paste into the client's month-end pack. reminders.md holds one draft per customer, the oldest balances first, followed by the two lists that need a different action: invoices QuickBooks never emailed, and invoices with no billing address. Each artifact carries a url on api.phoenix.so that downloads it for an hour, and reading the session again gives a fresh link.
A person at the firm reads the drafts before anything goes out. Check that the customer has not paid by a route QuickBooks does not show yet, such as a cheque in the post or a payment the client has not recorded, and check any customer on a payment plan or in a dispute, which the books alone cannot reveal. The transcript, GET /o/{org}/sessions/{id}/messages, keeps every query the agent sent and what came back, so any number in a draft can be traced to the invoice it came from.
Run it on every Monday morning
Run it once a week per client. In the console, a Project automation with a schedule trigger (a cron such as 0 8 * * 1 and the client's timezone) can run a saved agent that names that client's QuickBooks connection and holds this prompt, so the list is waiting when the week starts. An automation caps its own runs with max_runs_per_hour.
A firm with many clients can instead start the runs from its own practice system: one POST /o/{org}/sessions per client, each naming that client's QuickBooks connection by its id, and a run.completed webhook on the API key that files each client's overdue.csv where the bookkeeper will see it.
The use case this job follows, with its automation and trigger: Produce a report or file, no repo.
Why run it on Rush?
Receivables follow-up is the job that slips when a firm is busy, because it means opening each client's books, filtering, and writing careful emails one customer at a time. On Rush the client's QuickBooks sign-in lives in a connection the firm controls, each run gets its own computer, and the firm can run every client's list at once instead of one after another on someone's laptop.
Each run keeps a record a client can be shown: the queries, the invoices they returned, and the drafts. A session that used a QuickBooks connection is readable only by the person who started it and the org's owners and admins, even in a Project the whole firm shares, and GET /o/{org}/sessions?account=<realm id> lists every run that touched a given client's company.
Frequently asked questions
Does the agent email the customers itself?
No. It writes drafts to a file and the prompt rules out any change in QuickBooks. A person sends the reminders, from QuickBooks or their own mail, after checking them.
How do I run it for several client companies?
Connect each company with POST /me/connections {"type": "app", "name": "quickbooks"} and pick it on Intuit's page. Every one is named quickbooks, and a name two connections share is 422 CONNECTION_AMBIGUOUS, so name each by the id GET /me/connections lists.
Why are some invoices listed apart from the reminders?
An overdue invoice whose EmailStatus is NotSet or NeedToSend was never emailed from QuickBooks, so the customer may never have received it. Those need the invoice sent, not a reminder about it. Invoices with no BillEmail have no address to draft to.
Can it record a payment when a customer replies that they paid?
The connection's scope can write to the books, but this prompt keeps the run read only. Recording payments belongs with the person who can see the bank feed and confirm the money arrived.
More QuickBooks jobs
More jobs like this: Produce a report or file, no repo
- Find Where Users Drop Off in a PostHog Funnel (PostHog)
- Find Square Items to Reorder (Square)
- Run a Keyword Gap Analysis With Semrush (Semrush)