Ledger balances
Create balance monitor
How to create a balance monitor in Blnk.
POST
/
balance-monitors
curl -X POST "http://localhost:5001/balance-monitors" \
-H "Content-Type: application/json" \
-d '{
"balance_id": "bln_0be360ca-86fe-457d-be43-daa3f966d8f0",
"condition": {
"field": "debit_balance",
"operator": ">",
"value": 100000
},
"call_back_url": "https://api.myapp.com/balancemonitor"
}'
{
"monitor_id": "mon_e0e77b0c-4985-472a-9bf5-76a48b0259b0",
"balance_id": "bln_0be360ca-86fe-457d-be43-daa3f966d8f0",
"condition": {
"field": "debit_balance",
"operator": ">",
"value": 100000
},
"call_back_url": "https://api.myapp.com/balancemonitor",
"description": "",
"created_at": "2024-02-20T05:56:58.257315054Z"
}
If you’re using the auto-provisioned
Enterprise Core instance included with your Production License deployment, set the base URL to: https://ENTERPRISE_PUBLIC_URL/core.If you’re connecting to a different Core instance, use the publicly accessible base URL for that instance instead.Authorization
If set, the API uses an API key for authentication. Include the following header in your requests:X-blnk-key: <api-key>.
Replace <api-key> with your secret API key. Ensure the key is kept secure and not exposed in public repositories or client-side code.
See also: Scoped API keys and Secure your Blnk server.
Body
string
required
Specifies the balance id of the ledger balance to be monitored.
object
required
Defines the criteria for monitoring a specific balance type.
Show child attributes
Show child attributes
string
required
Specifies the balance type to be monitored. Every ledger balance has 6 balance types -
balance, inflight_balance, credit_balance, inflight_credit_balance , debit_balance, and inflight_debit_balance.string
required
Defines the comparison operator to apply. Accepted values: > (greater than), < (less than), or = (equal to).
integer
required
The threshold amount that triggers the balance monitor.
string
required
Specifies the URL where notifications will be sent when the balance crosses the defined threshold.
string
A brief explanation of the purpose of the monitor.
Response
All parameters from the request body also mean the same in the corresponding response JSON.
string
The unique id of the balance monitor.
string
Date and time when the monitor was created.
curl -X POST "http://localhost:5001/balance-monitors" \
-H "Content-Type: application/json" \
-d '{
"balance_id": "bln_0be360ca-86fe-457d-be43-daa3f966d8f0",
"condition": {
"field": "debit_balance",
"operator": ">",
"value": 100000
},
"call_back_url": "https://api.myapp.com/balancemonitor"
}'
{
"monitor_id": "mon_e0e77b0c-4985-472a-9bf5-76a48b0259b0",
"balance_id": "bln_0be360ca-86fe-457d-be43-daa3f966d8f0",
"condition": {
"field": "debit_balance",
"operator": ">",
"value": 100000
},
"call_back_url": "https://api.myapp.com/balancemonitor",
"description": "",
"created_at": "2024-02-20T05:56:58.257315054Z"
}
Need help?
We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool. To ask questions or discuss issues, please contact us or join our Discord community.Was this page helpful?
⌘I
curl -X POST "http://localhost:5001/balance-monitors" \
-H "Content-Type: application/json" \
-d '{
"balance_id": "bln_0be360ca-86fe-457d-be43-daa3f966d8f0",
"condition": {
"field": "debit_balance",
"operator": ">",
"value": 100000
},
"call_back_url": "https://api.myapp.com/balancemonitor"
}'
{
"monitor_id": "mon_e0e77b0c-4985-472a-9bf5-76a48b0259b0",
"balance_id": "bln_0be360ca-86fe-457d-be43-daa3f966d8f0",
"condition": {
"field": "debit_balance",
"operator": ">",
"value": 100000
},
"call_back_url": "https://api.myapp.com/balancemonitor",
"description": "",
"created_at": "2024-02-20T05:56:58.257315054Z"
}