Reports
Read-only aggregations covering the standard accounting reports + Indian GST returns. Every report respects the active org and optional branch_id scoping.
All responses follow the envelope { code: 0, message, <name>: {…} }. The internal success flag from the underlying handler is stripped. See Response envelope.
Financial statements
/reports/trial_balanceTrial balanceAIBooks.reports.READQuery: as_of_date (required), branch_id (optional).
GET /reports/trial_balance?as_of_date=2026-03-31T00:00:00/reports/profit_and_lossProfit & LossAIBooks.reports.READQuery: to_date (required), from_date (defaults to inception), branch_id (optional).
/reports/balance_sheetBalance SheetAIBooks.reports.READQuery: as_of_date (required), branch_id (optional). Returns assets / liabilities / equity trees with current-year P&L rolled in.
/reports/cash_flowCash Flow Statement (indirect)AIBooks.reports.READQuery: from_date + to_date (both required).
Receivables & Payables
/reports/ar_agingAR aging (0-30 / 31-60 / 61-90 / 90+)AIBooks.reports.READ/reports/ap_agingAP aging (same buckets)AIBooks.reports.READ/reports/outstanding_receivablesPer-customer unpaid invoicesAIBooks.reports.READ/reports/outstanding_payablesPer-vendor unpaid billsAIBooks.reports.READRegisters
/reports/sales_registerInvoices with HSN/SAC line breakdownAIBooks.reports.READ/reports/purchase_registerBills with HSN/SAC line breakdownAIBooks.reports.READ/reports/day_bookJournal entries by dateAIBooks.reports.READLedger
/reports/ledgerAccount ledger (single account)AIBooks.reports.READQuery: account_id (required), from_date, to_date, limit (max 10,000), branch_id.
/reports/customer_ledgerCustomer ledger (statement of account)AIBooks.reports.READQuery: contact_id (required, the customer), from_date, to_date, limit (1 – 10,000, default 5,000), branch_id. Opening balance, then every invoice, receipt, credit note, debit note, TDS entry, refund and manual journal that touches this customer's receivable, each with a running balance. Cancelled documents are skipped. Rows on a receipt or TDS entry carry appliedInvoices showing which invoice it was applied to.
GET /reports/customer_ledger?contact_id=ct_acme&from_date=2026-04-01T00:00:00
200 OK
{
"code": 0,
"message": "success",
"customer_ledger": {
"contact": { "id": "ct_acme", "name": "Acme Corp" },
"currency_code": "INR",
"from_date": "2026-04-01T00:00:00",
"to_date": null,
"opening_balance": 0.0,
"summary": { "total_debit": 23600.0, "total_credit": 10000.0, "closing_balance": 13600.0, … },
"entries": [
{ "id": "inv_abc", "date": "2026-05-12T00:00:00", "type": "INVOICE", "number": "INV-2026-0042",
"debit": 23600.0, "credit": 0, "running_balance": 23600.0, … }
]
}
}The report also carries advance-on-account and ageing blocks and INR-converted figures (*_inr) for foreign-currency customers; the example shows the main fields. Unknown contact_id returns 404.
/reports/vendor_ledgerVendor ledger (statement of account)AIBooks.reports.READSame query and shape as the customer ledger, with contact_id being the vendor, under the key vendor_ledger. Covers bills, payments, vendor credit notes, TDS withholding, refunds and manual journals against the vendor's payable. Cancelled bills are skipped.
/reports/contact_balancesClosing balance for every customer (or vendor)AIBooks.reports.READQuery: side (customer default, or vendor), branch_id. Computed the same way as the per-contact ledgers, so the figures agree with the statements. Useful for dashboards.
GET /reports/contact_balances?side=customer
200 OK
{
"code": 0,
"message": "success",
"contact_balances": { "balances": { "ct_acme": 13600.0, "ct_zenith": 0.0 } }
}balances is a map of contact id to closing balance. The value is the same closing_balance the matching ledger report shows for that contact.
GST returns
/reports/gstr1GSTR-1 (B2B + B2C + HSN summary)AIBooks.reports.READ/reports/gstr3bGSTR-3B (outward + inward + ITC + tax payable)AIBooks.reports.READQuery: from_date + to_date (typically the first and last day of the month being filed), branch_id (optional, for multi-GSTIN orgs).