Ledger balances
Update balance monitor
Update the details of a balance monitor with the Java SDK.
PUT
/balance-monitors/{monitor_id}Use blnk.balanceMonitor().update for this operation.
Call the method
String monitorId = "mon_073f7ffe-9dfd-42ce-aa50-d1dca1788adc";
MonitorCondition condition = MonitorCondition.create()
.field("credit_balance")
.operator(">=")
.precision(100)
.value(2000);
ApiResponse<JsonNode> response = blnk.balanceMonitor().update(
monitorId,
MonitorData.create()
.balanceId("bln_5ce86029-3c2e-4e2a-aae2-7fb931ca4c4f")
.description("Updated monitor")
.condition(condition));
| Field | Type | Description |
|---|---|---|
id | String | Monitor ID to update. |
balance_id | String | Balance to monitor. |
condition | MonitorCondition | Threshold rule built with MonitorCondition.create(). |
condition.field | String | Balance field to watch (for example credit_balance, debit_balance, balance). |
condition.operator | String | Comparison operator: >, <, =, !=, >=, <=. |
condition.value | Number | Threshold amount. |
condition.precision | Number | Currency precision (for example 100 for cents). |
call_back_url | String | Webhook URL when the condition is met. |
description | String | Optional description for the monitor. |
Confirm the update
On success, Core returns a confirmation message. Fetch the monitor with get balance monitor to verify the new condition and webhook URL.
Response
{
"message": "BalanceMonitor updated successfully"
}
| Field | Type | Description |
|---|---|---|
message | String | Confirmation from Core. |