Financial Reporting

Generate and retrieve financial reports with Open Ledger.

Open Ledger provides comprehensive financial reporting capabilities that allow businesses to generate essential financial statements and download them in PDF format. Our reporting system leverages the underlying ledger data structure to produce accurate and consistent financial insights.

Available Financial Reports

Balance Sheet

Snapshot of financial position at a specific date showing Assets = Liabilities + Equity.

Income Statement

Details revenues, costs, and expenses over a period to show net profit/loss.

Cash Flow Statement

Analyzes cash movements across operating, investing, and financing activities.

API Reference

Generating Financial Reports

To generate financial reports for an entity, use the following endpoint:

1GET /v1/reports/generate
2Authorization: Bearer {access_token}

Query Parameters

ParameterTypeDescription
entityIdstringRequired. The entity ID for report generation
monthintegerOptional. Month number (1-12)
yearintegerOptional. Year (e.g., 2024)
typestringOptional. Specific report type to generate

Response

1{
2 "balanceSheet": {
3 "assets": [
4 {
5 "name": "Cash",
6 "balance": 10500.0
7 },
8 {
9 "name": "Accounts Receivable",
10 "balance": 25000.0
11 }
12 // Additional asset accounts...
13 ],
14 "liabilities": [
15 {
16 "name": "Accounts Payable",
17 "balance": 15000.0
18 }
19 // Additional liability accounts...
20 ],
21 "equity": [
22 {
23 "name": "Owner's Capital",
24 "balance": 50000.0
25 }
26 // Additional equity accounts...
27 ],
28 "totalAssets": 150000.0,
29 "totalLiabilities": 75000.0,
30 "totalEquity": 75000.0
31 },
32 "incomeStatement": {
33 "revenue": [
34 {
35 "name": "Sales Revenue",
36 "balance": 100000.0
37 }
38 // Additional revenue accounts...
39 ],
40 "expenses": [
41 {
42 "name": "Rent Expense",
43 "balance": 5000.0
44 }
45 // Additional expense accounts...
46 ],
47 "totalRevenue": 120000.0,
48 "totalExpenses": 70000.0,
49 "netIncome": 50000.0
50 },
51 "cashFlowStatement": {
52 "operatingActivities": {
53 "items": [
54 {
55 "name": "Net Income",
56 "amount": 50000.0
57 }
58 // Additional operating activities...
59 ],
60 "total": 45000.0
61 },
62 "investingActivities": {
63 "items": [
64 {
65 "name": "Purchase of Equipment",
66 "amount": -10000.0
67 }
68 // Additional investing activities...
69 ],
70 "total": -15000.0
71 },
72 "financingActivities": {
73 "items": [
74 {
75 "name": "Loan Repayment",
76 "amount": -5000.0
77 }
78 // Additional financing activities...
79 ],
80 "total": -8000.0
81 },
82 "netCashChange": 22000.0,
83 "beginningCashBalance": 85000.0,
84 "endingCashBalance": 107000.0
85 },
86 "pdf_urls": {
87 "profit_loss": "https://storage.openledger.com/reports/pl-123456.pdf",
88 "balance_sheet": "https://storage.openledger.com/reports/bs-789012.pdf",
89 "cash_flow": "https://storage.openledger.com/reports/cf-345678.pdf"
90 }
91}

Generating General Ledger Report

To generate a general ledger report, which includes a detailed view of all accounts and their transactions:

1GET /v1/reports/general-ledger
2Authorization: Bearer {access_token}

Query Parameters

ParameterTypeDescription
entityIdstringRequired. The entity ID for report generation
monthintegerOptional. Month number (1-12)
yearintegerOptional. Year (e.g., 2024)

Response

1{
2 "accounts": [
3 {
4 "name": "Cash",
5 "type": "ASSET",
6 "financialType": "CASH",
7 "accountCode": 1010,
8 "subTypeCode": 1010,
9 "balance": {
10 "debits_pending": "1000.00",
11 "debits_posted": "11000.00",
12 "credits_pending": "0.00",
13 "credits_posted": "500.00",
14 "timestamp": "2024-01-15T00:00:00Z"
15 }
16 }
17 // Additional accounts...
18 ],
19 "entries": [
20 {
21 "id": "entry_123456",
22 "ledger_id": "ldgr_789012",
23 "debit_account_id": "acc_cash",
24 "credit_account_id": "acc_revenue",
25 "amount": 1000.0,
26 "description": "Service payment received",
27 "status": "POSTED",
28 "created_at": "2024-01-15T14:30:00Z"
29 }
30 // Additional entries...
31 ],
32 "pdf_url": "https://storage.openledger.com/reports/gl-123456.pdf",
33 "hierarchy": {
34 "assets": [
35 {
36 "id": "ASSET-CASH",
37 "name": "Cash",
38 "type": "ASSET",
39 "financialType": "CASH",
40 "balance": 11500.0,
41 "children": [
42 {
43 "id": "Cash-ASSET",
44 "name": "Cash",
45 "type": "ASSET",
46 "financialType": "CASH",
47 "balance": 11500.0,
48 "parentId": "ASSET-CASH",
49 "level": 1
50 }
51 ],
52 "parentId": null,
53 "level": 0,
54 "isCategory": true
55 }
56 // Additional account hierarchies...
57 ],
58 "liabilities": [],
59 "equity": [],
60 "revenue": [],
61 "expenses": []
62 }
63}

PDF Reports

All financial reports can be generated as beautifully formatted PDFs. These PDFs include:

  • Company header with logo and legal information
  • Professional formatting with account hierarchies
  • Clearly marked totals and subtotals
  • Proper accounting sign conventions (debits and credits)
  • Page numbers and timestamps

The PDF generation is handled automatically when you request financial reports, and download URLs are included in the response.

How to Use Financial Reports

1

Generate Reports via API

1// Example using fetch API
2const getFinancialReports = async (entityId, month, year) => {
3 const response = await fetch(
4 `https://api.openledger.com/v1/reports/generate?entityId=${entityId}&month=${month}&year=${year}`,
5 {
6 method: 'GET',
7 headers: {
8 'Authorization': `Bearer ${token}`,
9 'Content-Type': 'application/json'
10 }
11 }
12 );
13
14 const data = await response.json();
15
16 // Access the financial data and PDF links
17 console.log(data.incomeStatement.netIncome);
18 console.log(data.pdf_urls.profit_loss); // URL to download PDF
19};
20
21// Example usage
22getFinancialReports('entity_123abc', 1, 2024);
3

Customize Report Parameters

When generating reports, you can customize various aspects:

  • Specify entityId to select the entity for reporting

  • Include month and year for periodic reports

  • Optionally specify type to retrieve only a specific report type

4

Access the General Ledger

For detailed transaction-level reporting:

1const getGeneralLedger = async (entityId, month, year) => {
2 const response = await fetch(
3 `https://api.openledger.com/v1/reports/general-ledger?entityId=${entityId}&month=${month}&year=${year}`,
4 {
5 method: 'GET',
6 headers: {
7 'Authorization': `Bearer ${token}`,
8 'Content-Type': 'application/json'
9 }
10 }
11 );
12
13 const data = await response.json();
14
15 // Access account details, entries, and PDF link
16 console.log(data.accounts.length);
17 console.log(data.entries.length);
18 console.log(data.pdf_url); // URL to download PDF
19};
5

Download & Use PDFs

Access the PDF URLs returned in the response to download beautifully formatted reports for sharing or archiving.

Best Practices

  1. Generate reports at consistent intervals (monthly, quarterly, annually)
  2. Review reports for accuracy and investigate any unexpected figures
  3. Download and archive PDF reports for record-keeping
  4. Use report data to identify trends and inform business decisions
  5. Ensure all transactions are properly categorized before generating reports