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));
FieldTypeDescription
idStringMonitor ID to update.
balance_idStringBalance to monitor.
conditionMonitorConditionThreshold rule built with MonitorCondition.
create().
condition.fieldStringBalance field to watch (for example credit_balance, debit_balance, balance).
condition.operatorStringComparison operator: >, <, =, !=, >=, <=.
condition.valueNumberThreshold amount.
condition.precisionNumberCurrency precision (for example 100 for cents).
call_back_urlStringWebhook URL when the condition is met.
descriptionStringOptional 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"
}
FieldTypeDescription
messageStringConfirmation from Core.