Skip to main content

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

FieldTypeRequiredDescription
start_datestring (date)YesStart date (YYYY-MM-DD) for the report.
end_datestring (date)YesEnd date (YYYY-MM-DD) for the report.
group_by_account_lvl_3numberyesGroups ledger data by level 3 account.

Response Body Fields

FieldTypeAlways presentDescription
errorbooleanYesIndicates whether the request failed. false means success.
statusstringYesStatus string. On success the example returns "ok".
messagestringYesHuman-readable message. Often empty on success.
dataarray of objectYes (on success)Array of general-ledger object.

Response data Fields

FieldTypeDescriptionExample
idnumberGeneral ledger account identifier..1.1.01
level1numberParent account level identifier.1.0.00
namestringGeneral ledger account name.1.1.01 - Cash
account_detailarray of objectList of detailed accounts and their balances (see below).[ ... ]

Response data.account_detail Fields

FieldTypeDescriptionExample
idstringAccount detail identifier.1d772a20-f238-...
debitnumberTotal debit amount.0
creditnumberTotal credit amount.0
begining_debitnumberBeginning debit balance.137785961.42519987
begining_creditnumberBeginning credit balance.511000
balancenumberCurrent account balance. 137274961.42519987
beginingnumberBeginning account balance.137274961.42519987
namestringAccount name.1.1.01.02 - Payment Accounting1
labelstringAccount code and name label.1.1.01.02 - Payment Accounting1
level3stringLevel 3 parent account identifier.1.1.01
levelstringLevel 1 parent account identifier.1.0.00
codestringAccount 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"
}
]
}
]
}