General Ledger
Overview
The General Ledger endpoint returns general ledger account information for the requested date range. The response groups records by account and provides the account ID, level, name, and related account details. Each account contains detailed financial values used to represent its debit, credit, beginning balance, and current balance.
The account details also include account names, labels, hierarchy levels, and codes. This endpoint is commonly used to review account balances and analyze general ledger information within a specified accounting period.
Request Endpoint
- Method:
POST - Path:
{{base_url}}/api/reports/general_ledger
Payload Construction and Schema Definition
The request payload is submitted as form-data fields.
Request Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
start_date | string (date) | Yes | Start date (YYYY-MM-DD) for the report. |
end_date | string (date) | Yes | End date (YYYY-MM-DD) for the report. |
group_by_account_lvl_3 | number | yes | Groups ledger data by level 3 account. |
Response Body Fields
| Field | Type | Always present | Description |
|---|---|---|---|
error | boolean | Yes | Indicates whether the request failed. false means success. |
status | string | Yes | Status string. On success the example returns "ok". |
message | string | Yes | Human-readable message. Often empty on success. |
data | array of object | Yes (on success) | Array of general-ledger object. |
Response data Fields
| Field | Type | Description | Example |
|---|---|---|---|
id | number | General ledger account identifier.. | 1.1.01 |
level1 | number | Parent account level identifier. | 1.0.00 |
name | string | General ledger account name. | 1.1.01 - Cash |
account_detail | array of object | List of detailed accounts and their balances (see below). | [ ... ] |
Response data.account_detail Fields
| Field | Type | Description | Example |
|---|---|---|---|
id | string | Account detail identifier. | 1d772a20-f238-... |
debit | number | Total debit amount. | 0 |
credit | number | Total credit amount. | 0 |
begining_debit | number | Beginning debit balance. | 137785961.42519987 |
begining_credit | number | Beginning credit balance. | 511000 |
balance | number | Current account balance. | 137274961.42519987 |
begining | number | Beginning account balance. | 137274961.42519987 |
name | string | Account name. | 1.1.01.02 - Payment Accounting1 |
label | string | Account code and name label. | 1.1.01.02 - Payment Accounting1 |
level3 | string | Level 3 parent account identifier. | 1.1.01 |
level | string | Level 1 parent account identifier. | 1.0.00 |
code | string | Account code identifier. | 1d772a20-f238-... |
Expected System Responses
The system responds with HTTP 200 OK.
{
"error": false,
"status": "ok",
"message": "",
"data": [
{
"id": "1.1.01",
"level1": "1.0.00",
"name": "1.1.01 - Cash",
"account_detail": [
{
"id": "1d772a20-f238-11ea",
"debit": 0,
"credit": 0,
"begining_debit": 137785961.42519987,
"begining_credit": 511000,
"balance": 137274961.42519987,
"begining": 137274961.42519987,
"name": "1.1.01.02 - Payment Accounting1",
"label": "1.1.01.02 - Payment Accounting1",
"level3": "1.1.01",
"level1": "1.0.00",
"code": "1d772a20-f238-11ea"
}
]
}
]
}