---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://segmentstream.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Your company's books, in a ledger you own and your agents can work in.

Run your company's accounting on a ledger you own: journal entries, invoices, bills, bank reconciliation, period close and financial reports, with rules and approvals in code. Unlimited API access and full agent access over MCP. Move off Xero or QuickBooks side by side.

Finance teams, accountants and founders

Journal entries, invoices, bills, bank reconciliation and period close, on the same records as the rest of your company. Every posting runs through an action with its roles and approvals, whether a person makes it or an agent, and the whole database is yours, with unlimited API access.

[Start a pilot](https://segmentstream.com/solutions/accounting#pilot) · [Request access](https://segmentstream.com/solutions/accounting#waitlist)

Profit and loss from posted journal lines, by month and year to date, beside the checklist for closing the month.

northwind.segmentstream.app

![An accounting app's profit and loss for September 2026 against August and the year to date: revenue, cost of sales, gross profit, operating expenses and net profit, beside the gross margin and a checklist for closing September](https://segmentstream.com/screens/dark/mock-profit-and-loss.webp)

Finance teams, accountants and founders

## Company accounting: what it does

Tell your agent how your books work: your legal entities, chart of accounts and approval limits. It writes the ledger, invoice, bill and reconciliation actions with their roles, and segmentstream deploy gives you the app, the API and the MCP tools.

What it does

- Invoices, bills, journal entries and bank transactions share one ontology with the clients, vendors and contracts the rest of the company works on.
- Every posting goes through an action. The role is checked first, then the rule: an entry must balance, and a manual one over your threshold needs a second approver.
- Bank feeds come in on a schedule and each line is matched to an invoice, a bill or a transfer. The accountant confirms the rest and reconciles the account.
- A month closes through period.close, and nothing posts into it afterwards.
- Profit and loss and the balance sheet read straight from the posted journal lines.
- An agent connected over MCP issues invoices, posts journals and reconciles accounts for the accountant, under the same roles and approvals.
- The data is yours, in your own workspace, with unlimited API access and full agent access to your own database.

## What it covers

- ### General ledger

  A chart of accounts, journal entries and their lines, per legal entity and currency. An entry posts only when its debits equal its credits, and a posted entry is corrected by reversing it.

- ### Invoices and bills

  Invoices to your clients and bills from your vendors. Issuing an invoice or approving a bill posts its journal entry, under the approval rules written into the action.

- ### Bank feeds and reconciliation

  Bank lines from Mercury, Starling and Wise, and payouts from Stripe, matched to invoices, bills and transfers. The accountant confirms what is suggested and reconciles each account.

- ### Period close

  A month closes through period.close once every account is reconciled. Nothing posts into a closed period; corrections go to an open one.

- ### Financial reports

  Profit and loss, balance sheet and trial balance, computed from posted journal lines, by legal entity and month.

- ### [Your database, open to your agents →](https://segmentstream.com/platform/mcp)

  Every record is a REST API, a typed SDK and MCP tools, with no limit on API calls. Connected agents get full access to your own database, through the same roles as people.

## Built from typed blocks

No new product to buy: the blocks below, written by an agent into your workspace's repository and deployed with one command.

Entitiesontology/

- account
- journal_entry
- journal_line
- period
- invoice
- bill
- client
- vendor
- bank_transaction
- reconciliation

Actionsontology/

- invoice.issue
- bill.approve
- journal_entry.post
- journal_entry.reverse
- bank_transaction.match
- reconciliation.complete
- period.close

Rolesontology/roles.ts

- accountant
- finance_lead
- admin
- account_managerreads invoices

Connectionsconnections/

- mercury
- starling
- wise
- stripe
- xeroimport

Pipelinespipeline/

- bank_feeds
- match_bank_lines
- trial_balance

Appapp/

- Invoices
- Bills
- Bank
- Journal
- Reports

Agentagent/

- Any agent over MCP, as the accountant it works for

One deploy

$ segmentstream deploy

Every block ships together from one git repository your company owns. SegmentStream runs it.

account

- code
- name
- type
- currency

* journal_line

journal

\_​entry

- date
- memo
- source
- status

* period
* journal_line
* prepared by

- postaccountant
- reversefinance_lead

journal

\_​line

- debit
- credit
- description

* journal_entry
* account

period

- month
- legal entity
- status

* journal_entry

- closefinance_lead

invoice

- number
- currency
- total
- due date
- status

* client
* journal_entry

- issueaccountant

bill

- reference
- currency
- total
- status

* vendor
* journal_entry

- approvefinance_lead

bank

\_​transaction

- date
- payee
- amount
- status

* invoice
* bill
* journal_entry

- matchaccountant

reconciliation

- statement balance
- difference
- status

* account
* period

- completeaccountant

The entities, how they link, and which role may run each action. Your agent writes your own names and rules.

Rules live in actions

### The rule is code, not a setting someone can skip.

Every change goes through an action. The role that may run it is checked first, then the rule inside it. The same check applies to people in the app, to API keys and to agents over MCP.

ontology/journal-entry.ts

```
export const JournalEntry = entity("journal_entry", {
  description: "Balanced journal lines. A posted entry is never edited; it is reversed.",
  properties: {
    memo: p.text(),
    source: p.select(ENTRY_SOURCE),
    status: p.select(ENTRY_STATUS, { default: "draft", managed: true }),
  },
  relationships: {
    period: rel.one("period", { inverse: "entries" }),
    preparedBy: rel.one(User, { inverse: "preparedEntries" }),
  },
}).actions((self) => ({
  post: action({
    description: "Post a balanced entry into an open period.",
    input: Schema.Struct({ entry: self.ref }),
    handler: ({ input, principal }) =>
      Effect.gen(function* () {
        const entry = yield* self.get(input.entry, { forUpdate: true });
        const lines = yield* JournalLine.find({ where: { entry: { id: { eq: entry.id } } } });
        const debits = total(lines, "debitMinor");
        if (debits !== total(lines, "creditMinor"))
          return yield* reject("Debits and credits must balance.");
        const period = yield* Period.get(entry.periodId);
        if (period.status === "closed")
          return yield* reject("The period is closed. Post the correction to an open one.");
        if (entry.source === "manual" && debits > 250_000 && entry.preparedById === principal.id)
          return yield* reject("Over £2,500, someone other than the preparer posts it.");
        yield* self.update(entry, { status: "posted" });
      }),
  }),
}));
```

Inside SegmentStream

## Bank feeds and rates on a schedule.

Bank statements, exchange rates and Stripe sales load as pipelines, each run kept with its status and duration.

segmentstream.com

![The console's runs: pipeline runs for web attribution, platform costs, Stripe sales, product usage, daily rates and bank feeds, on a schedule or started by hand, each with its status, start time, duration and the data it covered](https://segmentstream.com/screens/dark/console-runs.webp)

Every pipeline run, on a schedule or started by hand, with its status and duration.

What it replaces

- Xero
- QuickBooks
- Sage
- month-end spreadsheets

Moving off Xero or QuickBooks

Run both until the numbers agree. History comes in through the old system's API; where it falls short, as Xero's API does with the general journal, the journals come in from your accountant's exports. Each month is reconciled against the old ledger, with no plug entries, before you switch.

Moving from

- [Xero](https://segmentstream.com/solutions/xero-alternative)
- [QuickBooks](https://segmentstream.com/solutions/quickbooks-alternative)

Done for you · Moving off Xero or QuickBooks

### We can do the whole move for you.

Our forward-deployed engineers take the migration end to end: the model, the export, the import, the side-by-side comparison, and the switch. It starts with a fixed-scope pilot, and nothing is switched off until the numbers match.

[Request a pilot](https://segmentstream.com/solutions/accounting#pilot) · [How the pilot works](https://segmentstream.com/enterprise)

Build it with your agent

## Build your own from the Bookkeeping blueprint.

The Bookkeeping blueprint gives Claude Code, Codex or Cursor the design, the questions to ask you, the rules that must always hold and their tests. Paste this prompt and your agent builds your own version on SegmentStream, shaped to how your company works.

[About the ](https://segmentstream.com/blueprints/bookkeeping)

[Bookkeeping](https://segmentstream.com/blueprints/bookkeeping)

[ blueprint →](https://segmentstream.com/blueprints/bookkeeping) · [View on GitHub](https://github.com/segmentstream/build-your-own/tree/main/blueprints/bookkeeping)

prompt for your coding agent

```
Read https://github.com/segmentstream/build-your-own/blob/main/AGENTS.md and follow it.
Build our Bookkeeping from the bookkeeping blueprint.
```

Have us build it

### Enterprise, with our engineers

Our engineers model your chart of accounts, entities and approval rules with your accountant, connect your banks and Stripe, bring your history in from Xero or QuickBooks, and reconcile month by month against the old ledger before you switch.

[Start a pilot](https://segmentstream.com/solutions/accounting#pilot)

Build it yourself

### Self-serve, with your own agent

Tell your agent how your books work: your legal entities, chart of accounts and approval limits. It writes the ledger, invoice, bill and reconciliation actions with their roles, and segmentstream deploy gives you the app, the API and the MCP tools.

`curl -fsSL https://segmentstream.com/install.sh | sh`

[Request access](https://segmentstream.com/solutions/accounting#waitlist)

## Related solutions

[Finance and accounting](https://segmentstream.com/solutions/finance)

[Contracts, revenue recognition and documents](https://segmentstream.com/solutions/finance)

·

[Sales and CRM](https://segmentstream.com/solutions/crm)

[Leads, deals and clients, shaped to how you sell](https://segmentstream.com/solutions/crm)

·

[Internal tools and dashboards](https://segmentstream.com/solutions/internal-tools)

[Pages and dashboards on your records and data](https://segmentstream.com/solutions/internal-tools)

## Questions

### Can an agent really work in the ledger?

Yes, through the same actions as a person. Connect an agent over MCP and it works as the accountant it acts for: it can issue an invoice, prepare and post a journal entry, match a bank line or reconcile an account. The role check, the balance rule and the approval threshold apply to it exactly as they do in the app, and every change is kept with who made it and when.

### What stops a wrong posting?

The actions. An entry posts only when it balances and never into a closed period, a manual entry over your threshold needs a second approver who did not prepare it, and a posted entry is corrected by reversing it, so the history stays whole.

### How do we move off Xero or QuickBooks?

Run both until the numbers agree. Contacts, invoices, bills and bank transactions come in through the old system's API. Xero's API does not provide the general journal, so the journals come in from the accountant's exports. Each month is then reconciled against the old ledger, with no plug entries, before you switch.

### Which banks connect?

Mercury, Starling, Wise and Airwallex connect directly, and Stripe payouts come in from Stripe. We connect other banks with you.

### Why keep the books in our own workspace?

Software written for your company and the agents working for it need all of your data, not an export. In your own workspace there is no limit on API calls, and agents get full access to your own database, within the roles you give them.

### Who owns the code?

The code lives in a private git repository for your workspace. Clone it with plain git, keep a copy wherever you like, take it with you. SegmentStream runs it.

Enterprise pilot

## Rather have it built for you? Start a pilot.

Our engineers model your chart of accounts, entities and approval rules with your accountant, connect your banks and Stripe, bring your history in from Xero or QuickBooks, and reconcile month by month against the old ledger before you switch.

- One solution, on your data, in your own workspace
- First version live in two weeks
- Parity proven before anything is switched off
- Fixed scope and price, credited to your contract if you continue

Not ready for a pilot? Send the form anyway with your question. An engineer will reply, not a sales rep.

[How the pilot works](https://segmentstream.com/enterprise)

NameWork email

CompanyWhat should the pilot cover?

Anything we should knowHow did you hear about us?

Goes to our founder’s inbox. No sales queue, no newsletter.

## Build your company’s own software. Let agents run it.

$ segmentstream workspace create acme --region eu --subdomain acme

▸ Created workspace acme · database, warehouse and a private git repository

$ segmentstream workspace WORKSPACE-ID clone acme && cd acme

▸ your coding agent builds what your team asked for and runs the checks

$ git add -A && git commit -m "First version"

$ segmentstream deploy

▸ app, company agent, API and MCP tools live for your invited members

[Start a pilot](https://segmentstream.com/solutions/accounting#pilot)

Our engineers build the first version on your data in two weeks, at a fixed price.

Or build it yourself with your coding agent:

`curl -fsSL https://segmentstream.com/install.sh | sh`

Work email

We’ll email you product updates, tips and onboarding help. Unsubscribe anytime.
