List transactions — GET /v1/books/transactions

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.

GET /v1/books/transactions

Addresshttps://api.hanzo.ai/v1/books/transactions
MethodGET
Operationget_books_transactions
AuthAuthorization: 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.

FieldInTypeRequiredDescription
sandboxquerystring—Sandbox reads the org's SANDBOX ledger when it is exactly "true".
fromquerystring—From is the RFC3339 start of the posting-time window, inclusive.
toquerystring—To is the RFC3339 end of the posting-time window, inclusive.
categoryquerystring—Category filters to one COA account, named by number ("5300") or by category slug ("software").
vendorquerystring—Vendor filters to rows whose vendor or description contains this text, case-insensitively.
limitqueryinteger—Limit caps how many rows come back; 200 when absent or not positive.

Response

StatusBodyMeaning
200books.transactionsOutok
defaultproblem-detailsrefused

200 body — 9 fields.

FieldInTypeAlwaysDescription
transactionsbodybooks.Txn[]—Transactions is the matching register rows, newest first.
transactions[].amountCentsbodyinteger (int64)—AmountCents is the voucher's total, in whole cents — its total debit, which equals its total credit because every voucher balances.
transactions[].categorybodystring—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[].categoryNamebodystring—CategoryName is that account's human name, so a caller need not carry the chart to render the row.
transactions[].datebodystring—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[].descriptionbodystring—Description is the line a person reads: the memo carried in from the source.
transactions[].sourcebodystring—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 the store.
transactions[].vendorbodystring—Vendor is the counterparty, resolved from whatever the source knew — a bank row's merchant, a scanned bill's supplier.
transactions[].voucherIdbodyinteger (int64)—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 transactions
import { 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 := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.BooksAPI.GetBooksTransactions(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::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.setBearerToken(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"

MCP reaches books through the books tool, which names its 20 operations with its own verbs — this one among them, under a name only MCP 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"
         }
       }
     }'

Books API · All Hanzo APIs · Interactive reference

Was this page useful?