Balance monitoring
Monitor balances and get notified via webhook
when they meet the set conditions.
Overview
Balance monitoring lets you keep track of the balances in your Blnk Ledger. This is important in building financial applications, especially in cases where specific balances have defined thresholds.
You can monitor all 3 sub-balances of a balance — credit balance (credit_balance
), debit balance (debit_balance
) and total balance (balance
).
See also → Create a balance.
Why monitor balances?
-
Fraud detection: Unusual balance changes can be an early indication of fraudulent activities. Monitoring can trigger alerts for suspicious transactions and ensure timely intervention.
-
Regulatory compliance: Many financial regulations require institutions to maintain specific balance threshold. Real-time balance monitoring makes it easy to comply with these regulations.
-
Customer notifications: Customers can be notified in real-time if their balance crosses a specific threshold. It can also be used for segmenting your customers in your application.
-
Operational efficiency: Instantly knowing when a balance reaches a certain threshold can trigger automatic actions, such as transferring funds between accounts or purchasing assets.
Set up balance monitoring
Determine and set your conditions
Select what should be monitored on a particular balance, e.g., notify me when the debit_balance
is above 100000.
Call the Create Balance Monitor endpoint and provide the following fields in the request payload:
Field | Description | Required? | Type |
---|---|---|---|
balance_id | Unique identifier of the balance to be monitored. | Yes | string |
condition | Object representing the condition to be satisfied. | Yes | |
field | Specific sub-balance to monitor. It can be debit_balance , credit_balance , or balance . | Yes | string |
operator | Indicates the comparison operation to be performed between the field and operator. See below → Supported operators. | Yes | string |
value | The value against which the field is compared. | Yes | int64 |
precision | Converts the value to lowest possible unit. Ensure that the precision specified is the same as the precision applied to the balance | Yes | int64 |
description | Description of your balance monitor. It is left empty if it’s not passed in the request. | No | string |
In this example, Blnk is asked to monitor the balance and send a notification when its debit_balance
is greater than 100000.
meta_data
in your request if you need to add custom data to your balance monitor. You're good to go!
Blnk stores your monitoring request with a unique monitor_id
. Once the condition is met, you will get instantly notified via the balance.monitor
webhook event.
See also → Setting up notifications.
Field | Description | Type |
---|---|---|
monitor_id | Unique identifier for your balance monitor. | string |
created_at | Date and time of creation. | string |
Supported operators
This is a list of all supported operators by the Balance monitor:
Operators | Symbol | Description |
---|---|---|
Greater than | > | Checks if the specified balance in field is greater than value |
Less than | < | Checks if the specified balance in field is less than value |
Equal to | = | Checks if the specified balance in field is exactly equal to value |
Not equal to | != | Checks if the specified balance in field is not equal to value |
Greater than or equal to | >= | Check if the specified balance in field is greater than or equal to value |
Less than or equal to | <= | Checks if the specified balance in field is less than or equal to value |
View balance monitor
You can request to see a list of all balance monitors in your application, or the details of a particular monitor.
To do this, call the Get Balance Monitor endpoint URL with the/
- Provide the
monitor_id
in the URL to see the details of a specific balance monitor. - Call the same URL without the
monitor_id
to see a list of all the balance monitors in your application.
See also → Search your Blnk data.
Update balance monitor
To update the conditions of a particular balance monitor, call the Update balance monitor endpoint using the monitor_id
and pass the updated conditions.
See also
Record a transaction
Post a transaction to your Blnk Ledger
Handling overdrafts
Learn how Blnk handles overdrafts
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?