Read the general ledger
Step-by-step use case to read the trial balance and then the general ledger of an account through the NovaFisko API, with the running balance.
This guide retrieves the trial balance of a fiscal year, then the detailed movements of an account with its running balance. It is intended for reporting, consolidation and dashboard tools.
Prerequisites: a token with the read ability and the public_token of the company.
Step 1: find the fiscal year
Statements are always calculated for a fiscal year, identified by its id.
curl https://api.novafisko.com/v1/companies/k3Jd9fPq2LmX/fiscal-years \
-H "Authorization: Bearer $NOVAFISKO_TOKEN"
[
{
"id": 6,
"code": "2025",
"starts_on": "2025-01-01T00:00:00.000000Z",
"ends_on": "2025-12-31T00:00:00.000000Z",
"is_closed": true,
"closed_at": "2026-03-14T10:22:05.000000Z",
"periods": []
},
{
"id": 7,
"code": "2026",
"starts_on": "2026-01-01T00:00:00.000000Z",
"ends_on": "2026-12-31T00:00:00.000000Z",
"is_closed": false,
"closed_at": null,
"periods": [
{"id": 85, "number": 1, "label": "01/2026", "starts_on": "2026-01-01T00:00:00.000000Z", "ends_on": "2026-01-31T00:00:00.000000Z", "is_locked": true}
]
}
]
Step 2: read the trial balance
The trial balance gives, for each account with movements, the debit and credit totals and the balance. It is the natural entry point: it shows which accounts are worth detailing.
curl "https://api.novafisko.com/v1/companies/k3Jd9fPq2LmX/fiscal-years/7/trial-balance?from=2026-01-01&to=2026-09-30" \
-H "Authorization: Bearer $NOVAFISKO_TOKEN"
| Parameter | Default | Description |
|---|---|---|
from |
start of the fiscal year | Start date, inclusive |
to |
end of the fiscal year | End date, inclusive |
include_empty |
false |
true to include accounts whose totals are zero |
{
"fiscal_year": "2026",
"from": "2026-01-01",
"to": "2026-09-30",
"lines": [
{
"account_id": 90,
"number": "440000",
"label": "Fournisseurs",
"type": "liability",
"debit": "48210.35",
"credit": "55120.80",
"debit_balance": "0.00",
"credit_balance": "6910.45",
"balance": "-6910.45"
},
{
"account_id": 118,
"number": "604000",
"label": "Achats de marchandises",
"type": "expense",
"debit": "31874.20",
"credit": "412.00",
"debit_balance": "31462.20",
"credit_balance": "0.00",
"balance": "31462.20"
}
],
"totals": {
"debit": "412587.14",
"credit": "412587.14",
"is_balanced": true,
"result": "18240.66"
}
}
The balance field is signed: positive for a debit balance, negative for a credit balance. totals.result is the result of the period, positive for a profit and negative for a loss. totals.is_balanced must always be true.
Step 3: read the general ledger of an account
The general ledger is read account by account, with the account_id obtained from the trial balance or from GET accounts.
curl "https://api.novafisko.com/v1/companies/k3Jd9fPq2LmX/fiscal-years/7/general-ledger/118?from=2026-07-01&to=2026-09-30" \
-H "Authorization: Bearer $NOVAFISKO_TOKEN"
{
"account_id": 118,
"from": "2026-07-01",
"to": "2026-09-30",
"opening_balance": "20918.75",
"movements": [
{
"line_id": 5388,
"entry_id": 1790,
"entry_date": "2026-07-03",
"journal": "ACH",
"document": "2026/000171",
"label": "Fûts 20 L blonde",
"reference": "F-2026-0611",
"third_party": "Brasserie des Collines SA",
"debit": "980.00",
"credit": "0.00",
"balance": "21898.75",
"reconciliation_code": null
},
{
"line_id": 5521,
"entry_id": 1842,
"entry_date": "2026-09-30",
"journal": "ACH",
"document": "2026/000212",
"label": "Fûts 20 L blonde",
"reference": "F-2026-0918",
"third_party": "Brasserie des Collines SA",
"debit": "1250.00",
"credit": "0.00",
"balance": "31462.20",
"reconciliation_code": null
}
],
"totals": {
"debit": "10955.45",
"credit": "412.00",
"balance": "31462.20"
}
}
| Field | Description |
|---|---|
opening_balance |
Balance brought forward: movements of the fiscal year prior to from |
movements[].balance |
Running balance after the movement |
movements[].document |
Document number in the format fiscal year/number on six digits |
movements[].reconciliation_code |
Lettering code, null if the line is not lettered |
totals.balance |
Closing balance: opening_balance plus the debits minus the credits |
Movements are sorted by date, then by entry, then by line position. This route is not paginated: limit the period with from and to for accounts with many movements.
Step 4: trace back to the entry
Each movement carries an entry_id. The complete entry, with all its lines, is read as follows:
curl https://api.novafisko.com/v1/companies/k3Jd9fPq2LmX/entries/1842 \
-H "Authorization: Bearer $NOVAFISKO_TOKEN"
Complete example: the whole general ledger in Python
import os
import requests
BASE = "https://api.novafisko.com/v1"
COMPANY = "k3Jd9fPq2LmX"
FISCAL_YEAR = 7
session = requests.Session()
session.headers.update({
"Authorization": f"Bearer {os.environ['NOVAFISKO_TOKEN']}",
"Accept": "application/json",
})
balance = session.get(
f"{BASE}/companies/{COMPANY}/fiscal-years/{FISCAL_YEAR}/trial-balance", timeout=60
).json()
assert balance["totals"]["is_balanced"]
ledger = {}
for line in balance["lines"]:
# One call per account that actually moved during the year
ledger[line["number"]] = session.get(
f"{BASE}/companies/{COMPANY}/fiscal-years/{FISCAL_YEAR}/general-ledger/{line['account_id']}",
timeout=60,
).json()
for number, account in sorted(ledger.items()):
print(number, account["totals"]["balance"], len(account["movements"]), "movements")
If you need the complete general ledger in a single file, use the export: GET exports/general-ledger?format=csv&fiscal_year_id=7. It accepts account_from and account_to to bound a range of accounts. See Export the full dossier.
Other statements available
| Route | Content |
|---|---|
fiscal-years/{id}/balance-by-period |
Balance broken down by period |
fiscal-years/{id}/financial-statements |
Balance sheet and income statement |
journals/{id}/entries |
Book of a journal, with from and to |
third-party-balance/{type} |
Balance of customers (customer) or suppliers (supplier) |
aged-balance/{type} |
Aged balance |
fiscal-years/{id}/consistency |
Consistency checks of the fiscal year |
integrity |
Integrity check of the company |
A fiscal year that is unknown or belongs to another company responds 404. The same goes for an account of another company.