# Prepare Month-End Accruals From Ramp Bills

Yes. An agent reads Ramp bills and recurring vendors, then returns accruals.csv for last month with an amount, GL category and basis for each line.

[Run this on Rush](https://cloud.getrush.ai/run/month-end-accruals/ramp/).

## What the agent does

The run reads Ramp through Ramp's remote MCP server, `https://ramp-mcp-remote.ramp.com/mcp`, the Ramp entry in the Rush connector catalog. Connect it once with `POST /me/connections {"type": "mcp", "name": "ramp", "url": "https://ramp-mcp-remote.ramp.com/mcp", "auth": {"mode": "oauth"}}` and approve it in Ramp from the `authorize_url`. In Ramp's open-source server (`ramp-public/ramp-mcp`), data is loaded first with tools such as `load_bills`, `load_transactions` and `load_vendors`, then queried with SQL through `execute_query`; the agent works the same way, which suits a three-month comparison.

It loads three months of bills and card transactions. The first accrual list is simple: bills whose invoice date falls in last month and which are not yet paid. Each line takes the bill's amount, vendor and the accounting category on the bill, and its basis says "bill received, unpaid" with the bill's invoice number and date.

The second list is the one that takes judgement: vendors that charged or billed in each of the two months before last but have nothing dated last month. For each, the agent estimates the accrual as the average of the earlier months, and flags the vendor when those months differ by more than a quarter, because an average of two very different bills is a weak estimate. The category comes from the vendor's earlier bills or transactions.

Last, it checks for doubles. A vendor whose bill for last month arrived this month is already in the first list if it is dated last month, so the agent matches by vendor before adding an estimate. It writes `accruals.csv` and `accruals.md`, and calls no tool that pays, approves or edits anything.

## Start it with one API call

`POST https://api.prix.dev/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Use the Ramp connection to read bills, card transactions and vendors for the last 3 calendar months. Write accruals.csv for last month with one line per accrual: (1) unpaid bills with an invoice date in last month, and (2) vendors that billed or charged in each of the two prior months but have no bill or charge dated last month, estimated from their average. Columns: vendor, amount, GL category, type (bill or estimate), basis (invoice number and date, or the months averaged). Write accruals.md explaining each estimate and flagging any whose source months differ by more than 25%. Do not count a vendor twice. Read only: pay, approve and edit nothing.",
  "connections": [
    "ramp"
  ]
}
```

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.prix.dev/o/{org}/sessions, with your repository as the resources URL. 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 session returns two artifacts. `accruals.csv` has one row per accrual with vendor, amount, GL category, whether it is a received bill or an estimate, and the basis, so it can be imported as a draft journal entry or pasted into the close workbook. `accruals.md` lists every estimate with the months and amounts it averaged, the flagged ones first.

A bookkeeper still owns the entry. Before booking it, check the flagged estimates against what you know about the vendor (an annual renewal billed once looks like a missing month), confirm that the GL categories Ramp returned match your chart of accounts, and look for accruals your Ramp data cannot show, such as payroll or contracts billed outside Ramp. The transcript keeps every SQL query the agent ran over the loaded data, so the source of any number can be traced.

## Run it on every month-end close

Run it on the first business day of the month, once last month's cards have settled and most bills are in. A Project automation on a monthly schedule can send the request, or your close checklist tool can call `POST /o/{org}/sessions` when the close starts.

Sending the same request again a few days later, after late bills arrive, gives a fresh schedule; comparing the two shows which estimates were replaced by real bills. The `run.completed` webhook tells your server each schedule is ready.

## Why run it on Rush?

The slow part of accruals is not the unpaid bills, which Ramp already lists. It is spotting the vendor who has not billed yet and working out a fair estimate. The agent does that comparison over three months of data in its own sandbox and writes down the arithmetic for every estimate, instead of leaving it in someone's spreadsheet.

The work is read only by prompt, every query is kept with its result, and the output is a file a person reviews before anything is booked. A firm that closes several clients' books can run one session per client at once, each with its own connection and its own files, up to the key's concurrent run limit.

## Frequently asked questions

### Does it post the journal entry?

No. It writes a CSV and an explanation, and the prompt rules out any change in Ramp. Booking the entry stays with your team and your accounting system.

### How does it estimate a vendor with no bill yet?

It averages that vendor's amounts in the two months before last, and accruals.md shows those amounts. When the two differ by more than 25% the line is flagged for a person to decide.

### What about annual or quarterly vendors?

A three-month window cannot see a yearly bill, and a quarterly one can look like a missing month. Tell the agent in the prompt which vendors bill on a longer cycle, or widen the window to twelve months.

### Which Ramp permissions does the connection need?

Read access to bills, transactions and vendors. Ramp asks for consent when you open the authorize_url, and the connection acts as the Ramp user who approved it.
