Balances
What are balances?
Balances are the amount of a unit linked to an account. There are three types
of balances, main
, children
, and custom
. Accounts can have balances, and each balance has a unit.
Balances contain:
balance
- the sum of all completed transactions.available_balance
- a balance not including pending balance.pending_balance
- the sum of all pending transactions.negative_pending_balance
- the sum of all negative pending transactions.
Main balances
Main balances are the balances belonging to the account directly.
Children balances
Children balances are the sum of the balances belonging to the account's children. Custom balances do not get included in children's balances.
Custom balances
Custom balances you can create, it's not managed by Modernbanc, and you need to assign the balance amount directly. This feature is helpful for syncing balances with external systems. Note to use a custom balance, you cannot attach the unit to the account on creation, or it will default to the main type. You must create an account without the unit and create a custom balance.
Usage
Create balance
You can add balance to accounts at any time. For example, when a new currency is added to the account. Another example could be if you're a grocery store and started carrying baguettes and want to track the number of baguettes you have in stock or that were sold. You can create the unit, link it to your workspace, and then create a balance to link it to a specific account.
- On the UI, balances are created when you attach units to accounts.
- Navigate to the
Accounts
page, or pressG
and thenA
. - Click the
Create
button in the top right. - Select a unit from the
Units
dropdown, and now the account will have balances for each one attached to the account.
- Navigate to the
Update balance
Only custom balances can be updated manually. In the case of non-custom balances, the balance will be updated automatically when transactions are created and completed.
For this example, let's pretend we're a retailer that sells glasses, and we want to update our starting inventory. So we'll use the glasses balance we created earlier and update the balance to 1000.
- On the UI, balances are updated via transactions.
- To update a balance, create a transaction with the unit you want to update the balance for, and the transaction will handle updating the balance.