My Areas

Sign in to follow product and topic areas and get a shortcut in this menu
Visma eAccounting API
cancel
Showing results for 
Search instead for 
Did you mean: 
Anour Hannouch
  • 0 Replies
  • 0 kudos
  • 20 Views

Endpoint: PUT v2/fiscalyears/openingbalances

 

1. Usability

The purpose of this endpoint is to allow the user to update its opening balances on the first fiscal year through the API using a simple collection of account numbers and their new opening balances. Below you can see the Opening Balance section as you would like to update in eAccounting.

Opening Balance in eAccounting

Opening Balance in eAccounting

In order to achieve the same behavior through the API, the following payload should be used:

Opening Balance in API

Opening Balance in API

As you can see the account numbers which we wanted to update in the web application can be found in the JSON, next to its balance. The new balances represent the new total amounts that we want to have on the specific accounts, which do not amount or diminish the previous ones but instead replacing them. You can also specify some or all the other accounts in the fiscal year, as long as the total amount balances or you set the balance as it currently is.
The endpoint by default supports using inactive accounts in the JSON by automatically activating them. If you do not wish to allow this, set the parameter enableInactiveAccounts to false in which case validation will be thrown.

Scenario 1

We have the following accounts with their current balances:

  • account 1010 ; opening balance: 10
  • account 1229 ; opening balance: -10
  • all the other account have 0 opening balances

We would like to update the balance on account 1010 to 20. In order to successfully accomplish that, we need to set up a new amount on another account based on the new difference. In this case we will use account 1229 to counter the new added amount.
The required JSON will be :

Scenario 1

Scenario 1

Note: You can also use other accounts as long as the amounts balance or either their current amount is used.

Scenario 2

We have the following accounts with their current balances:

  • account 1010 ; opening balance: 10
  • account 1229 ; opening balance: 20
  • account 1210 ; opening balance: 30
  • account 1470; opening balance: -60
  • all the other accounts have 0 opening balances

We would like to update the opening balance of another account, for example, 1220 to -20. Below is an example of a way of doing it:

At a first glance, the amounts in the JSON do not balance. -20 + 50 = 30. But below you can observe all the accounts with their updated amounts:

  • account 1010 ; opening balance: 10
  • account 1229 ; opening balance: 20
  • account 1210 ; opening balance: 50 (the account we have used to counterbalance the new amount)
  • account 1470; opening balance: -60
  • account 1220; opening balance: -20 (the updated amount which we've entered)
  • all the other accounts have 0 opening balances
    As a result 10 + 20 + 50 - 60 - 20 = 0. Success!
 

2. Quick tips and sum up about functionality

  • since the opening balance always needs to sum up to 0, a minimum of 2 pairs of account - opening balance needs to be used.
  • opening balance can only be updated on the first fiscal year, which depending on your case, might not be the current fiscal year.
  • the endpoint supports the use of a minimum of 2 accounts up to the total number of accounts in the first fiscal year. Also, the use of inactive accounts is possible through the specific parameter, which will automatically activate it.
  • the endpoint works by replacing the previous amounts, not by adding or subtracting to them.
  • using the same amount on an account as it currently holds is possible, though it will not be updated.
  • the whole chart of accounts on the fiscal year can be used in the JSON. This might be useful when complex amounts and calculations are required
  • if validation is thrown stating that your new amounts do not balance, although the amounts in your JSON body do (example 1010: 20 ; 1020 : -20), please check the amounts currently hold on other accounts in the fiscal year. A good example is Scenario 2.
Contributors