Ledger Event Handler

A ledger event handler processes ledgerable events into ledger transactions. Creating a ledgerable event requires linking it to an existing ledger event handler. The ledgerable event must meet the conditions on the ledger event handler.

For every ledgerable event that is created, there must be a ledger event handler which matches following its conditions field. On a match, we create a ledger transaction following the template defined in the ledger_transaction_template field.

📘

This is an Early Access feature.

Features in early access may undergo changes in the future. Reach out to your customer success manager or support team in case of any questions.

AttributeDescription
id
string
Unique identifier for the Ledger Event Handler.
name
string
Name for the Ledger Event Handler.
description
string
An optional free-form description.
conditions
object
An object in the form of:
{ field: "ledgerable_event.name", operator: "equals", value: "<ledgerable_event_name>" }
The value field would be what ledgerable event name you want to match to this handler.
variables
object
An object in the form of:
{ "<variable_name>": { type: "ledger_account", query: { field: "<field>", operator: "<operator>", value: "<value>" } }, ... }
There may be many variable names. They may be referred to from within the ledger_transaction_template using {{variables.<variable_name>.<field>}} syntax.
ledger_transaction_template
object
An object in the form of a Ledger Transaction.
Ledgerable Event fields may be referenced using the {{ledgerable_event.<field_name>}} syntax.
Variables may be referenced using the {{variables.<variable_name>.<field_name>}} syntax.
metadata
object
Additional data represented as key-value pairs. Both the key and value must be strings. See Metadata.
live_mode
boolean
This field will be true if this object was created with a production API key or false if created with a test API key.