If you want to be alerted or trigger a process when a ledger account exceeds a given range, you can use a
ledger_account_balance_monitor. You can find the API reference for Ledger Account Balance Monitors here and the webhook information here.
Balance monitors should be used for cases where ledger accounts are allowed to exit a certain range, but where this activity needs to be flagged. For example, you may have a range within which a cash or user account should remain over the normal course of business, outside of which operational users should be alerted.
For ledger accounts that should never exceed a given range (e.g. user balances that should never go below zero), you can use balance locking on ledger entry creation. See Handling Concurrency.
One the balance monitor is created, it will send an initial webhook which reflects the initial state. Then, every time the alert condition transitions from
true, a webhook will be sent.
An alert condition is comprised of three parts; the field, operator, and value.
field denotes the specific balance/value we are comparing against.is one of
operator is used compare the
field against the
value. It is one of
value is the comparison value which is compared against the value retrieved through the
Updated 3 months ago