Create a balance
Overview
This guide shows you how to create and connect a balance to an existing ledger. A Balance represents the source or destination of a transaction record.
The Blnk Ledger is designed based on the Double Entry Accounting Principle; this means that all transactions must have a source (credit record) and a destination (debit record)
Balances are always updated whenever a new transaction is recorded, and they can be used to track the flow of funds within your application ensuring that your books are always balanced.
Every Balance is made up of 3 sub-balances:
- Credit balance: Total sum of all credits that’s happened on a balance.
- Debit balance: Total sum of all debits that’s happened on a balance.
- Total balance: Calculated by subtraction the Debit balance from the Credit balance.
Create a balance
Create a ledger
You cannot create a Balance without an existing ledger. If you do not have a ledger created yet, click here to create one.
Create a balance
Call the create-balance endpoint and provide the required fields.
Field | Description | Required | Type |
---|---|---|---|
ledger_id | The unique id of the ledger that this balance belongs to | Yes | string |
currency | The currency in which transactions recorded in this balance will be recorded | Yes | string |
meta_data | Custom data associated with the balance being created | No | object |
Do not use one balance to record transactions with different currency
values. When recording transactions in a particular balance, The Blnk Ledger assumes all transactions in that balance have the same currency
value.
Your balance gets created
Once your Balance has been created, you can move on to record your first transaction in your Blnk Ledger.
Field | Description | Type |
---|---|---|
balance_id | The unique id of the balance you created. | string |
balance | Sum of credit_balance and debit_balance . | int64 |
inflight_balance | Sum of inflight_credit_balance and inflight_debit_balance . | int64 |
credit_balance | Sum of all credit transaction amounts in the balance. | int64 |
inflight_credit_balance | Total amount waiting to be added to your balance. | int64 |
debit_balance | Sum of all debit transaction amounts in the balance. | int64 |
inflight_debit_balance | Total amount waiting to be deducted from your balance. | int64 |
inflight_expires_at | Date and time for inflight to expire. | string |
created_at | Date and time of creation. | string |
View your balance
To view the details of a particular balance in your Blnk Ledger, call the Get Balance endpoint URL — /balance/[balance_id]
. Provide the balance_id
to fetch the details of a specific balance in real time.
See also → Search your Blnk data.
See also
Need help?
Are you stuck? Do you have a question that isn’t answered in this doc? Have you run into a problem you can’t solve? Want to file a bug report?
Join our Discord server and share your questions/thoughts with other developers building financial applications like you.
Was this page helpful?