My Products
Help
jackmonto
CONTRIBUTOR **

Finding the usable balance from API endpoint `generalLedgerBalance`

by jackmonto

We're using an API endpoint called GeneralLedgerBalanceV2 to fetch the account balance for each account over the course of a year, as we need this data for some calculations. However, when querying for a specific period (eg, 202301), we're receiving multiple values ​​for the same account.


To handle this issue, we've implemented logic to select the balance value based on the lastModifiedDateTime, assuming that the most recent value is the most accurate. However, we're unsure if this approach is correct.


Additionally, we've already configured the parameters to request balanceType as 'actual'.

Example Response (part of it) for more context:

[
{
"balanceType": "Actual",
"financialPeriod": "202301",
"beginningBalance": 11241.3100,
"yearToDateBalance": 13234.5200,
"yearClosed": false,
"lastModifiedDateTime": "2023-04-01T08:38:46.443",
},
{
"balanceType": "Actual",
"financialPeriod": "202301",
"beginningBalance": 0.0000,
"yearToDateBalance": 0.0000,
"yearClosed": false,
"lastModifiedDateTime": "2021-08-05T08:08:35.283"
},
{
"balanceType": "Actual",
"financialPeriod": "202301",
"beginningBalance": 0.0000,
"yearToDateBalance": 0.0000,
"yearClosed": false,
"lastModifiedDateTime": "2023-09-15T10:22:15.217"
}
]
5 REPLIES 5
jackmonto
CONTRIBUTOR **

by jackmonto (Updated ‎19-04-2024 09:44 by jackmonto )

HI Rozhat,
Thank you for replying.

Example request is

/generalLedgerBalance?toggleBalanceSigns=true&periodId=202301&balanceType=Actual&account=1460

Rozhat
VISMA

by Rozhat

Hi, what parameters do you send with the call

jackmonto
CONTRIBUTOR **

by jackmonto

HI Rozhat,
Thank you for replying.

Example request is

/generalLedgerBalance?toggleBalanceSigns=true&periodId=202301&balanceType=Actual&account=1460

Rozhat
VISMA

by Rozhat

Your approach of selecting the balance value based on the lastModifiedDateTime is correct 

jackmonto
CONTRIBUTOR **

by jackmonto

Hi Rozhat!

Thank you for previous answer.

We have found that the balance we retrieve does not match what is stated in the balance sheet PDF that can be exported from Visma.net, for the same period and same account.

Do you know what the reason can be?