List trial

Returns the org's trial balance over an optional [from, to] window of RFC3339 posting times, including the opening/closing columns and the TotalDebit == TotalCredit proof that the books balance.

GET /v1/books/trial

Addresshttps://api.hanzo.ai/v1/books/trial
MethodGET
Operationget_books_trial
AuthAuthorization: Bearer $HANZO_API_KEY

Returns the org's trial balance over an optional [from, to] window of RFC3339 posting times, including the opening/closing columns and the TotalDebit == TotalCredit proof that the books balance.

Request

3 fields.

FieldInTypeRequiredDescription
sandboxquerystring—Sandbox reads the org's SANDBOX ledger when it is exactly "true".
fromquerystring—From is the RFC3339 start of the window, exclusive.
toquerystring—To is the RFC3339 end of the window, inclusive.

Response

StatusBodyMeaning
200books.TrialBalanceok
defaultproblem-detailsrefused

200 body — 15 fields.

FieldInTypeAlwaysDescription
balancedbodyboolean—Balanced is the proof this report exists to give: whether total debits equal total credits.
frombodystring—From is the posting time the window opens at, as it was asked for.
rowsbodybooks.TrialBalanceRow[]—Rows are the accounts that MOVED in one of the windows.
rows[].accountbodystring—Account is the chart-of-accounts NUMBER this line reports on ("1000", "4000") — the stable posting key, not a display label.
rows[].closingCreditbodyinteger (int64)—ClosingCredit is that closing balance in cents when it is a credit balance.
rows[].closingDebitbodyinteger (int64)—ClosingDebit is the balance at the end of the window, in cents, when it is a debit balance.
rows[].creditbodyinteger (int64)—Credit is the same window movement in cents when it was net credit.
rows[].debitbodyinteger (int64)—Debit is the account's MOVEMENT within the window — closing minus opening, not the closing balance — in cents, when that movement was net debit.
rows[].namebodystring—Name is that account's human name from the fixed chart.
rows[].openingCreditbodyinteger (int64)—OpeningCredit is the same opening balance in cents when it fell on the credit side.
rows[].openingDebitbodyinteger (int64)—OpeningDebit is the account's balance before the window began, in whole cents, when that balance was on the debit side.
rows[].typebodystring—Type is the account's fundamental class — asset, liability, income, expense or equity — which is also its normal balance side.
tobodystring—To is the posting time the window closes at, inclusive.
totalCreditbodyinteger (int64)—TotalCredit is the sum of every row's closing credit column, in cents.
totalDebitbodyinteger (int64)—TotalDebit is the sum of every row's CLOSING debit column, in cents.

Failure carries the platform error shape — see Errors.

Examples

hanzo books trial
import { Configuration, BooksApi } from 'hanzoai';

const api = new BooksApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getBooksTrial();
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_trial()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.BooksAPI.GetBooksTrial(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_trial(&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).getBooksTrial();
curl https://api.hanzo.ai/v1/books/trial \
  -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?