# How Can Bookkeeping Software Find Customer Payments Still Sitting in Undeposited Funds? One Agent per Client Company in QuickBooks

Software for bookkeeping firms makes one agent per client company, signed into its QuickBooks, that lists payments left in Undeposited Funds each week.

[Run this on Rush](https://cloud.getrush.ai/run/find-payments-not-yet-deposited/quickbooks/). Opens the console with this prompt ready to send. Connect QuickBooks there first.

## What the agent does

This is for a company that makes practice software for small bookkeeping firms, each of which keeps the books for twenty to a hundred small businesses in QuickBooks Online. A common mess at month end is Undeposited Funds: a customer payment is recorded against an invoice, it lands in that holding account, and nobody records the bank deposit that moves it out, so the bank account looks short and the payment looks like it never arrived. Intuit's SDK reference for a payment's `DepositToAccountRef` says "If not specified, the Undeposited Funds account will be used", so every payment recorded without a deposit account starts there. The software makes one agent per client company and each week shows the bookkeeper the payments that have sat there too long.

The software's own staff connect the company's own QuickBooks first, since a template names connections its creator has, and save the template with `POST /o/{org}/agents`, naming `quickbooks` in `connections`. When a bookkeeper adds a client, the software calls `POST /o/{org}/agents {"template": "<template id>", "name": "undeposited-<client id>"}` and `POST /o/{org}/agents/{agent}/connections {"type": "app", "name": "quickbooks"}`, and the bookkeeper, who is a user on the client's QuickBooks, signs in on Intuit's page and picks that company. Rush stores the company's realm id with the connection. The software keeps the map from its client to the agent id and registers no Intuit app.

On a run the agent uses the QuickBooks Online Accounting API's query endpoint for the company. It reads the Undeposited Funds account with a query on `Account`, then reads `Payment` records with a `TxnDate` from the last 120 days, keeping those whose `DepositToAccountRef` is that account or is empty. It reads `Deposit` records for the same period; Intuit's reference describes a deposit as moving "a payment from the customer held in the Undeposited Funds account into the Bank account", and a deposit's lines carry `LinkedTxn` entries naming the transactions they include. Every payment no deposit links to is still in Undeposited Funds.

For each of those payments it records the date, the customer, the amount, the payment method and reference number when they are set, and the invoices the payment was applied to, and counts the days since `TxnDate`. It groups the payments by age (over 7, over 14 and over 30 days) and adds the total per group, and it lists separately any payment whose amount matches a bank deposit already in QuickBooks on a nearby date that links nothing, since that is often the deposit recorded straight to the bank instead of through Undeposited Funds. It creates, edits and deletes nothing in the books.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "<agent id>",
  "input": "Weekly Undeposited Funds review for this QuickBooks company. Today is 2026-11-23. Use the QuickBooks Online Accounting API query endpoint. 1) Query Account where Name = 'Undeposited Funds' and note its Id. 2) Query Payment where TxnDate >= '2026-07-26', paging with STARTPOSITION and MAXRESULTS; keep payments whose DepositToAccountRef is the Undeposited Funds account or is not set. 3) Query Deposit where TxnDate >= '2026-07-26' and collect every Payment id named in a deposit line's LinkedTxn. 4) Every kept payment not in that set is still undeposited. For each, give Id, TxnDate, customer name, TotalAmt, payment method and PaymentRefNum if set, the invoice numbers in its lines' LinkedTxn, and days since TxnDate. Group by over 30, over 14, over 7 days, and 7 or fewer, with a total per group. 5) List separately any bank Deposit with no LinkedTxn within 5 days of an undeposited payment of the same amount, as a possible duplicate. Return JSON only: {as_of, undeposited_account_id, groups: [{label, total, payments: [...]}], possible_duplicates: [{payment_id, deposit_id, amount, payment_date, deposit_date}]}. Read only: never create, update, void or delete anything."
}
```

1. **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.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
3. **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 answer is JSON in the session's `result` and in the `run.completed` webhook the software's API key sends: the payments still in Undeposited Funds for that client, grouped by age with a total per group, and a short list of payments that may already have been deposited straight to the bank. The software puts it on the client's page in the bookkeeper's dashboard and sorts the firm's clients by the oldest undeposited payment, so the worst books are seen first.

What the bookkeeper checks before fixing anything: the bank feed, to find the real deposit each payment went into (several payments often make one deposit); a possible duplicate, which needs a person to decide which entry stays; and a payment from a card processor that pays out net of fees, where the deposit is less than the payments in it. The bookkeeper records the deposits in QuickBooks; the agent only finds what is missing.

## Run it on every Monday morning, per client company

The software's scheduler sends one `POST /o/{org}/sessions` per client company on Monday morning, with the client's agent id as `agent`, today's date and the 120-day window in `input`, and a `request_id` that is a UUID v5 of the client id and the date, so a retried job does not run twice. The week before a client's month-end close, the bookkeeper can start an extra run from the client's page.

A firm with eighty clients starts eighty runs at once. Runs past the API key's concurrent limit wait `queued` and start as earlier ones finish, each on its own computer, and the software reads each result from its webhook.

## Why run it on Rush?

Each client company is its own QuickBooks connection, held by that client's agent and nothing else: no run can read another client's books, and the session's `accounts` names the company's realm id, so `GET /o/{org}/sessions?account=<realm id>` lists every run that read one client's books. The software never stores an Intuit token, and the bookkeeper signs in on Intuit's own page.

The check is mechanical but tedious across a hundred companies, and it is easy to forget until a client's bank reconciliation will not balance. Each run keeps a record of every query it made, so when a client asks why a payment was flagged, the bookkeeper opens the session. The `total_cost_usd` of one client's sessions shows what the check costs per client, which the software needs to price it into a firm's plan.

## Frequently asked questions

### Why 120 days of payments?

A payment left in Undeposited Funds for months is exactly the one this check exists to find, so the window reaches back further than a month. Change it in the template's instructions; every client's agent uses the change on its next run.

### Can the agent record the deposit for us?

The QuickBooks connection could, since its accounting scope reads and writes, but this template forbids it. Matching payments to the real bank deposit needs the bank statement, and a wrong deposit is harder to undo than a missing one, so a bookkeeper records it.

### What if a client uses a different holding account?

Put the account's name in the prompt in place of Undeposited Funds. The agent reads the account by name first and stops with a clear message if it does not exist, so a renamed account is never silently skipped.

### What happens when a client's QuickBooks sign-in lapses?

When Intuit refuses the stored grant, that client's connection reads `needs_reauth` in `GET /o/{org}/agents/{agent}/connections`, and the run cannot read the books. The software checks that list, asks the bookkeeper to sign in again for that client, and the next Monday's run works as before.

## More QuickBooks jobs

- [Which Customer Payments Never Got Applied to an Invoice? A Month-End Close App's Check of Each Client's QuickBooks](https://getrush.ai/run/find-unapplied-customer-payments/quickbooks/)
- [Find Last Month's Uncategorized Expenses in QuickBooks Before the Close](https://getrush.ai/run/find-uncategorized-expenses/quickbooks/)
- [Which Estimates Are Still Waiting for an Answer? A Landscaping Company's Monday Follow-Up List From QuickBooks](https://getrush.ai/run/follow-up-on-open-estimates/quickbooks/)

## More jobs like this: Run an agent per customer task

- [Which Ramp Transactions and Bills Failed to Sync to the Books? A Bookkeeping Firm's Close Check, One Agent per Client](https://getrush.ai/run/find-ramp-items-that-failed-to-sync/ramp/)
- [Which Regulars Haven't Booked in a While? Barbershop Software That Finds Each Shop's Lapsed Clients in Square Appointments](https://getrush.ai/run/find-regulars-who-stopped-booking/square/)
- [Which Posts Scheduled for Next Week Are Still in Draft? Social Scheduling Software Checks Each Customer's Notion Content Calendar](https://getrush.ai/run/find-scheduled-posts-still-in-draft/notion/)

## Keep reading

- [Connect QuickBooks to Rush once, then name it on any run](https://getrush.ai/integrations/quickbooks/)
- [Start your first run from the developer API quickstart](https://getrush.ai/docs/quickstart/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
