Returns the org's booked ledger as a single-line register, newest first: one…
Returns the org's booked ledger as a single-line register, newest first: one row per voucher, with its date, description, vendor, category, source and…
GET /v1/books/transactions
| Address | https://api.hanzo.ai/v1/books/transactions |
| Method | GET |
| Operation | get_books_transactions |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns the org's booked ledger as a single-line register, newest first: one row per voucher, with its date, description, vendor, category, source and amount in exact cents. It is the double-entry ledger projected to the register a human reads, filterable by posting-time window, category and vendor. Strictly read-only — it restates the books, it never moves them.
Request
6 fields.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
sandbox | query | string | — | Sandbox reads the org's SANDBOX ledger when it is exactly "true". |
from | query | string | — | From is the RFC3339 start of the posting-time window, inclusive. |
to | query | string | — | To is the RFC3339 end of the posting-time window, inclusive. |
category | query | string | — | Category filters to one COA account, named by number ("5300") or by category slug ("software"). |
vendor | query | string | — | Vendor filters to rows whose vendor or description contains this text, case-insensitively. |
limit | query | integer | — | Limit caps how many rows come back; 200 when absent or not positive. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | transactionsOut | ok |
200 body — 9 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
transactions | body | Txn[] | — | Transactions is the matching register rows, newest first. |
transactions[].amountCents | body | integer | — | AmountCents is the voucher's total, in whole cents — its total debit, which equals its total credit because every voucher balances. |
transactions[].category | body | string | — | Category is the chart-of-accounts NUMBER of the income or expense account this voucher touched — where it lands on the P&L, not a free-text label. |
transactions[].categoryName | body | string | — | CategoryName is that account's human name, so a caller need not carry the chart to render the row. |
transactions[].date | body | string | — | Date is when the voucher POSTED — the accounting date the reports window on, which for an imported bank row is the bank's date and not the day it landed here. |
transactions[].description | body | string | — | Description is the line a person reads: the memo carried in from the source. |
transactions[].source | body | string | — | Source is where the entry came from: bank_txn for an imported statement line, scan for a receipt or bill read by the scanner, commerce_txn for a sale booked by… |
transactions[].vendor | body | string | — | Vendor is the counterparty, resolved from whatever the source knew — a bank row's merchant, a scanned bill's supplier. |
transactions[].voucherId | body | integer | — | VoucherID identifies the underlying double-entry voucher, so a caller can open the full set of legs behind this single register line. |
Failure carries the platform error shape — see Errors.
Examples
hanzo books transactionsimport { Configuration, BooksApi } from 'hanzoai';
const api = new BooksApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getBooksTransactions();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import BooksApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = BooksApi(client).get_books_transactions()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.BooksAPI.GetBooksTransactions(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, books_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = books_api::get_books_transactions(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.BooksApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new BooksApi(client).getBooksTransactions();curl https://api.hanzo.ai/v1/books/transactions \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches books through the books tool, which names its 24 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_book_accounts"
}
}
}'How is this guide?