OpenapiBooks
Returns the org's trial balance over an optional [from, to] window of RFC3339…
Returns the org's trial balance over an optional [from, to] window of RFC3339 posting times, including the opening/closing columns and the TotalDebit ==…
GET /v1/books/trial
| Address | https://api.hanzo.ai/v1/books/trial |
| Method | GET |
| Operation | get_books_trial |
| Auth | Authorization: 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.
| 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 window, exclusive. |
to | query | string | — | To is the RFC3339 end of the window, inclusive. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | TrialBalance | ok |
200 body — 15 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
balanced | body | boolean | — | Balanced is the proof this report exists to give: whether total debits equal total credits. |
from | body | string | — | From is the posting time the window opens at, as it was asked for. |
rows | body | TrialBalanceRow[] | — | Rows are the accounts that MOVED in one of the windows. |
rows[].account | body | string | — | Account is the chart-of-accounts NUMBER this line reports on ("1000", "4000") — the stable posting key, not a display label. |
rows[].closingCredit | body | integer | — | ClosingCredit is that closing balance in cents when it is a credit balance. |
rows[].closingDebit | body | integer | — | ClosingDebit is the balance at the end of the window, in cents, when it is a debit balance. |
rows[].credit | body | integer | — | Credit is the same window movement in cents when it was net credit. |
rows[].debit | body | integer | — | 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[].name | body | string | — | Name is that account's human name from the fixed chart. |
rows[].openingCredit | body | integer | — | OpeningCredit is the same opening balance in cents when it fell on the credit side. |
rows[].openingDebit | body | integer | — | OpeningDebit is the account's balance before the window began, in whole cents, when that balance was on the debit side. |
rows[].type | body | string | — | Type is the account's fundamental class — asset, liability, income, expense or equity — which is also its normal balance side. |
to | body | string | — | To is the posting time the window closes at, inclusive. |
totalCredit | body | integer | — | TotalCredit is the sum of every row's closing credit column, in cents. |
totalDebit | body | integer | — | TotalDebit is the sum of every row's CLOSING debit column, in cents. |
Failure carries the platform error shape — see Errors.
Examples
hanzo books trialimport { 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 := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.BooksAPI.GetBooksTrial(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_trial(&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).getBooksTrial();curl https://api.hanzo.ai/v1/books/trial \
-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?