> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Midaz events

> Reference all public JSON event facts emitted by Midaz, including CloudEvents headers, application topics, delivery behavior, and complete data contracts.

Midaz emits its public JSON business facts as **CloudEvents 1.0** in binary content mode over Kafka.

## Public JSON ledger catalog

The public ledger manifest contains the following verified definitions. Every cataloged definition has a non-test production emission path.

| Cataloged | Emitted | Catalog-only |
| -: | -: | -: |
| 54 | 54 | 0 |

## CloudEvents envelope

Every public JSON fact uses the shared envelope below. The headers carry routing and schema information. The Kafka value carries the JSON `data` object.

| Header | Presence and value |
| - | - |
| `ce-specversion` | Always `1.0`. |
| `ce-id` | Always; opaque producer-defined event identifier. |
| `ce-source` | Always `ledger`. |
| `ce-type` | Always `studio.lerian.ledger.<resource>.<event>`. |
| `ce-time` | Always; RFC 3339 emission timestamp. |
| `ce-resourcetype` | Always; the resource token from the definition key. |
| `ce-eventtype` | Always; the event token from the definition key. |
| `ce-subject` | Set by the payload-specific expression listed with each contract. |
| `ce-tenantid` | **Always present.** Your tenant ID, or the literal `default` when the event has no tenant. |
| `ce-schemaversion` | `1.1.0` for the six operation-route and transaction-route facts; `1.0.0` for the other 48. |
| `ce-datacontenttype` | `application/json`. |

## Topics, manifest, and routing

The application topic identifies the producing application, not an individual event. Route a record by `ce-resourcetype` and `ce-eventtype`, and validate `ce-schemaversion` before decoding its `data` value.

* **Facts:** `lerian.streaming.ledger`
* **Route DLQ:** `lerian.streaming.ledger.dlq`
* **Manifest:** `GET /v1/streaming/manifest` exposes the public JSON catalog and topic mapping, including while publication is disabled.

## Delivery and failure semantics

Publication is disabled until `STREAMING_ENABLED=true` and broker configuration succeeds. When enabled, Midaz emits after the business-state change. It does not use a transactional outbox.

* **Policy:** every public JSON definition is a `fact` with direct delivery, `on_routable_failure` DLQ handling, and `fallback_on_circuit_open`.
* **Actual Midaz boundary:** because Midaz has no outbox, the circuit-open fallback cannot persist an event. Emit paths log and swallow publication errors instead of returning them to the business command.
* **Consumer requirement:** broker delivery is at least once for published records. Make handlers idempotent and deduplicate with `(ce-source, ce-id)`.

## Separate legacy RabbitMQ plane

Midaz also has compatibility exchanges for selected overdraft and audit notifications. They are a separate legacy RabbitMQ plane and do not carry the full 54-event public JSON catalog. New integrations should use the Kafka contract on this page.

## Complete `data` contracts

These TypeScript-style declarations mirror the producer wire shape. Every field name is its JSON name. `?` means the field has `omitempty`. `| null` means the field is nullable and the producer always includes it. A source-type comment preserves the inventory type exactly. Decimal values are JSON strings, never binary floating-point numbers.

### Shared source-type mappings

```typescript theme={null}
type DecimalString = string // JSON encoding of decimal.Decimal
type JsonRawMessage = unknown // Go: json.RawMessage

type MmodelStatus = { // Go: mmodel.Status
  code: string // string; wire null: false; omitempty: false
  description: string | null // *string; wire null: true; omitempty: false
}

type BalanceSettings = { // Go: mmodel.BalanceSettings
  balanceScope?: string // string; wire null: false; omitempty: true
  allowOverdraft: boolean // bool; wire null: false; omitempty: false
  overdraftLimitEnabled: boolean // bool; wire null: false; omitempty: false
  overdraftLimit?: string // *string; wire null: false; omitempty: true
}

type AccountingRubric = { // Go: mmodel.AccountingRubric
  code: string // string; wire null: false; omitempty: false
  description: string // string; wire null: false; omitempty: false
}

type AccountingEntry = { // Go: mmodel.AccountingEntry
  debit: AccountingRubric | null // *AccountingRubric; wire null: true; omitempty: false
  credit: AccountingRubric | null // *AccountingRubric; wire null: true; omitempty: false
}

type AccountingEntries = { // Go: mmodel.AccountingEntries
  direct?: AccountingEntry // *AccountingEntry; wire null: false; omitempty: true
  hold?: AccountingEntry // *AccountingEntry; wire null: false; omitempty: true
  commit?: AccountingEntry // *AccountingEntry; wire null: false; omitempty: true
  cancel?: AccountingEntry // *AccountingEntry; wire null: false; omitempty: true
  revert?: AccountingEntry // *AccountingEntry; wire null: false; omitempty: true
  overdraft?: AccountingEntry // *AccountingEntry; wire null: false; omitempty: true
  block?: AccountingEntry // *AccountingEntry; wire null: false; omitempty: true
  unblock?: AccountingEntry // *AccountingEntry; wire null: false; omitempty: true
}

type AccountRule = { // Go: mmodel.AccountRule
  ruleType?: string // string; wire null: false; omitempty: true
  validIf?: unknown // any; wire null: false; omitempty: true
}

type TransactionGroupPart = { // Go: events.TransactionGroupPart
  transactionId: string // string; wire null: false; omitempty: false
  organizationId: string // string; wire null: false; omitempty: false
  ledgerId: string // string; wire null: false; omitempty: false
  role: string // string; wire null: false; omitempty: false
  status: string // string; wire null: false; omitempty: false
}
```

<AccordionGroup>
  <Accordion title="account.closed">
    **Event:** `studio.lerian.ledger.account.closed`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the closing of an account. `closedAt` is the closing instant.

    **Subject:** account ID (`p.ID`)

    ```typescript theme={null}
    // account.closed
    type AccountClosedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      closedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="account.created">
    **Event:** `studio.lerian.ledger.account.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the opening of an account in a ledger.

    **Subject:** account ID (`p.ID`)

    ```typescript theme={null}
    type AccountStatusPayload = {
      code: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    // account.created
    type AccountCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      name: string // string; wire null: false; omitempty: false
      assetCode: string // string; wire null: false; omitempty: false
      type: string // string; wire null: false; omitempty: false
      portfolioId: string | null // *string; wire null: true; omitempty: false
      segmentId: string | null // *string; wire null: true; omitempty: false
      parentAccountId: string | null // *string; wire null: true; omitempty: false
      entityId: string | null // *string; wire null: true; omitempty: false
      holderId: string | null // *string; wire null: true; omitempty: false
      alias: string | null // *string; wire null: true; omitempty: false
      status: AccountStatusPayload // AccountStatusPayload; wire null: false; omitempty: false
      blocked: boolean | null // *bool; wire null: true; omitempty: false
      holderCheckSkipped: boolean // bool; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="account.deleted">
    **Event:** `studio.lerian.ledger.account.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the deletion of an account.

    **Subject:** account ID (`p.ID`)

    ```typescript theme={null}
    // account.deleted
    type AccountDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      portfolioId: string | null // *string; wire null: true; omitempty: false
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="account.updated">
    **Event:** `studio.lerian.ledger.account.updated`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** An account's mutable fields change.

    **Subject:** account ID (`p.ID`)

    ```typescript theme={null}
    type AccountStatusPayload = {
      code: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    // account.updated
    type AccountUpdatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      name: string // string; wire null: false; omitempty: false
      portfolioId: string | null // *string; wire null: true; omitempty: false
      segmentId: string | null // *string; wire null: true; omitempty: false
      entityId: string | null // *string; wire null: true; omitempty: false
      status: AccountStatusPayload // AccountStatusPayload; wire null: false; omitempty: false
      blocked: boolean | null // *bool; wire null: true; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="asset.created">
    **Event:** `studio.lerian.ledger.asset.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the registration of an asset in a ledger.

    **Subject:** asset ID (`p.ID`)

    ```typescript theme={null}
    type AssetStatusPayload = {
      code: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    // asset.created
    type AssetCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      name: string // string; wire null: false; omitempty: false
      type: string // string; wire null: false; omitempty: false
      code: string // string; wire null: false; omitempty: false
      status: AssetStatusPayload // AssetStatusPayload; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="asset.deleted">
    **Event:** `studio.lerian.ledger.asset.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the deletion of an asset.

    **Subject:** asset ID (`p.ID`)

    ```typescript theme={null}
    // asset.deleted
    type AssetDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="asset.updated">
    **Event:** `studio.lerian.ledger.asset.updated`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** An asset's mutable fields change.

    **Subject:** asset ID (`p.ID`)

    ```typescript theme={null}
    type AssetStatusPayload = {
      code: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    // asset.updated
    type AssetUpdatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      name: string // string; wire null: false; omitempty: false
      type: string // string; wire null: false; omitempty: false
      code: string // string; wire null: false; omitempty: false
      status: AssetStatusPayload // AssetStatusPayload; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="balance.changed">
    **Event:** `studio.lerian.ledger.balance.changed`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A committed transaction moves a balance (one event per balance-affecting operation). Values reflect the state after the operation.

    **Subject:** transaction ID and operation ID (`p.TransactionID + ":" + p.OperationID`)

    ```typescript theme={null}
    // balance.changed
    type BalanceChangedDataV1 = {
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      accountId: string // string; wire null: false; omitempty: false
      balanceId: string // string; wire null: false; omitempty: false
      alias?: string // string; wire null: false; omitempty: true
      assetCode: string // string; wire null: false; omitempty: false
      balanceKey: string // string; wire null: false; omitempty: false
      available: DecimalString // decimal.Decimal; wire null: false; omitempty: false
      onHold: DecimalString // decimal.Decimal; wire null: false; omitempty: false
      version: number // int64; wire null: false; omitempty: false
      reason: string // string; wire null: false; omitempty: false
      operationType: string // string; wire null: false; omitempty: false
      direction?: string // string; wire null: false; omitempty: true
      amount: DecimalString // decimal.Decimal; wire null: false; omitempty: false
      transactionId: string // string; wire null: false; omitempty: false
      operationId: string // string; wire null: false; omitempty: false
      occurredAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="balance.config_changed">
    **Event:** `studio.lerian.ledger.balance.config_changed`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A balance's settings change, or overdraft is enabled (companion balance materialized). `changeType` discriminates `settings_updated` from `overdraft_enabled`.

    **Subject:** balance ID (`p.ID`)

    ```typescript theme={null}
    // balance.config_changed
    type BalanceConfigChangedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      accountId: string // string; wire null: false; omitempty: false
      alias?: string // string; wire null: false; omitempty: true
      key: string // string; wire null: false; omitempty: false
      allowSending: boolean // bool; wire null: false; omitempty: false
      allowReceiving: boolean // bool; wire null: false; omitempty: false
      direction?: string // string; wire null: false; omitempty: true
      settings?: BalanceSettings // *mmodel.BalanceSettings; wire null: false; omitempty: true
      changeType: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="balance.created">
    **Event:** `studio.lerian.ledger.balance.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the creation of a balance during account setup.

    **Subject:** balance ID (`p.ID`)

    ```typescript theme={null}
    // balance.created
    type BalanceCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      accountId: string // string; wire null: false; omitempty: false
      alias?: string // string; wire null: false; omitempty: true
      key: string // string; wire null: false; omitempty: false
      assetCode: string // string; wire null: false; omitempty: false
      accountType?: string // string; wire null: false; omitempty: true
      available: DecimalString // decimal.Decimal; wire null: false; omitempty: false
      onHold: DecimalString // decimal.Decimal; wire null: false; omitempty: false
      allowSending: boolean // bool; wire null: false; omitempty: false
      allowReceiving: boolean // bool; wire null: false; omitempty: false
      direction?: string // string; wire null: false; omitempty: true
      settings?: BalanceSettings // *mmodel.BalanceSettings; wire null: false; omitempty: true
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="balance.deleted">
    **Event:** `studio.lerian.ledger.balance.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the deletion of a balance.

    **Subject:** balance ID (`p.ID`)

    ```typescript theme={null}
    // balance.deleted
    type BalanceDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      accountId: string // string; wire null: false; omitempty: false
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="balance.overdraft_cleared">
    **Event:** `studio.lerian.ledger.balance.overdraft_cleared`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** Overdraft is fully repaid, a terminal signal (`action` = `cleared`).

    **Subject:** transaction ID and operation ID (`p.TransactionID + ":" + p.OperationID`)

    ```typescript theme={null}
    // balance.overdraft_cleared
    type BalanceOverdraftClearedDataV1 = {
      balanceId: string // string; wire null: false; omitempty: false
      accountId: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      assetCode: string // string; wire null: false; omitempty: false
      transactionId: string // string; wire null: false; omitempty: false
      operationId: string // string; wire null: false; omitempty: false
      action: string // string; wire null: false; omitempty: false
      amount: DecimalString // decimal.Decimal; wire null: false; omitempty: false
      overdraftBalance: DecimalString // decimal.Decimal; wire null: false; omitempty: false
      overdraftLimit?: DecimalString // *decimal.Decimal; wire null: false; omitempty: true
      occurredAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="balance.overdraft_drawn">
    **Event:** `studio.lerian.ledger.balance.overdraft_drawn`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A debit consumes overdraft beyond available funds (`action` = `drawn`).

    **Subject:** transaction ID and operation ID (`p.TransactionID + ":" + p.OperationID`)

    ```typescript theme={null}
    // balance.overdraft_drawn
    type BalanceOverdraftDrawnDataV1 = {
      balanceId: string // string; wire null: false; omitempty: false
      accountId: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      assetCode: string // string; wire null: false; omitempty: false
      transactionId: string // string; wire null: false; omitempty: false
      operationId: string // string; wire null: false; omitempty: false
      action: string // string; wire null: false; omitempty: false
      amount: DecimalString // decimal.Decimal; wire null: false; omitempty: false
      overdraftBalance: DecimalString // decimal.Decimal; wire null: false; omitempty: false
      overdraftLimit?: DecimalString // *decimal.Decimal; wire null: false; omitempty: true
      occurredAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="balance.overdraft_repaid">
    **Event:** `studio.lerian.ledger.balance.overdraft_repaid`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** Overdraft usage decreases but is not fully cleared (`action` = `repaid`).

    **Subject:** transaction ID and operation ID (`p.TransactionID + ":" + p.OperationID`)

    ```typescript theme={null}
    // balance.overdraft_repaid
    type BalanceOverdraftRepaidDataV1 = {
      balanceId: string // string; wire null: false; omitempty: false
      accountId: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      assetCode: string // string; wire null: false; omitempty: false
      transactionId: string // string; wire null: false; omitempty: false
      operationId: string // string; wire null: false; omitempty: false
      action: string // string; wire null: false; omitempty: false
      amount: DecimalString // decimal.Decimal; wire null: false; omitempty: false
      overdraftBalance: DecimalString // decimal.Decimal; wire null: false; omitempty: false
      overdraftLimit?: DecimalString // *decimal.Decimal; wire null: false; omitempty: true
      occurredAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="fee_billing_packages.created">
    **Event:** `studio.lerian.ledger.fee_billing_packages.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the creation of a billing package.

    **Subject:** billing package ID (`p.ID`)

    ```typescript theme={null}
    // fee_billing_packages.created
    type FeeBillingPackagesCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      type: string // string; wire null: false; omitempty: false
      pricingModel: string | null // *string; wire null: true; omitempty: false
      countMode: string | null // *string; wire null: true; omitempty: false
      enable: boolean // bool; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="fee_billing_packages.deleted">
    **Event:** `studio.lerian.ledger.fee_billing_packages.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the deletion of a billing package.

    **Subject:** billing package ID (`p.ID`)

    ```typescript theme={null}
    // fee_billing_packages.deleted
    type FeeBillingPackagesDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="fee_billing_packages.updated">
    **Event:** `studio.lerian.ledger.fee_billing_packages.updated`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A billing package's mutable fields change.

    **Subject:** billing package ID (`p.ID`)

    ```typescript theme={null}
    // fee_billing_packages.updated
    type FeeBillingPackagesUpdatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      type: string // string; wire null: false; omitempty: false
      pricingModel: string | null // *string; wire null: true; omitempty: false
      countMode: string | null // *string; wire null: true; omitempty: false
      enable: boolean // bool; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="fee_charge.applied">
    **Event:** `studio.lerian.ledger.fee_charge.applied`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the application of a fee package to a committed transaction.

    **Subject:** transaction ID (`p.TransactionID`)

    ```typescript theme={null}
    // fee_charge.applied
    type FeeChargeAppliedDataV1 = {
      transactionId: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      feePackageId: string // string; wire null: false; omitempty: false
      appliedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="fee_packages.created">
    **Event:** `studio.lerian.ledger.fee_packages.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the creation of a fee package.

    **Subject:** fee package ID (`p.ID`)

    ```typescript theme={null}
    // fee_packages.created
    type FeePackagesCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      segmentId: string | null // *string; wire null: true; omitempty: false
      transactionRoute: string | null // *string; wire null: true; omitempty: false
      enable: boolean // bool; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="fee_packages.deleted">
    **Event:** `studio.lerian.ledger.fee_packages.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the deletion of a fee package.

    **Subject:** fee package ID (`p.ID`)

    ```typescript theme={null}
    // fee_packages.deleted
    type FeePackagesDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="fee_packages.updated">
    **Event:** `studio.lerian.ledger.fee_packages.updated`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A fee package's mutable fields change.

    **Subject:** fee package ID (`p.ID`)

    ```typescript theme={null}
    // fee_packages.updated
    type FeePackagesUpdatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      segmentId: string | null // *string; wire null: true; omitempty: false
      transactionRoute: string | null // *string; wire null: true; omitempty: false
      enable: boolean // bool; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="holder.created">
    **Event:** `studio.lerian.ledger.holder.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the creation of a holder.

    **Subject:** holder ID (`p.ID`)

    ```typescript theme={null}
    // holder.created
    type HolderCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      type: string // string; wire null: false; omitempty: false
      externalId: string | null // *string; wire null: true; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="holder.deleted">
    **Event:** `studio.lerian.ledger.holder.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the deletion of a holder.

    **Subject:** holder ID (`p.ID`)

    ```typescript theme={null}
    // holder.deleted
    type HolderDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      deletionType: string // string; wire null: false; omitempty: false
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="holder.updated">
    **Event:** `studio.lerian.ledger.holder.updated`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A holder's mutable fields change.

    **Subject:** holder ID (`p.ID`)

    ```typescript theme={null}
    // holder.updated
    type HolderUpdatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      type: string // string; wire null: false; omitempty: false
      externalId: string | null // *string; wire null: true; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="instrument.created">
    **Event:** `studio.lerian.ledger.instrument.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the creation of an instrument for a holder and account.

    **Subject:** instrument ID (`p.ID`)

    ```typescript theme={null}
    type InstrumentRelatedPartyPayload = {
      relatedPartyId: string // string; wire null: false; omitempty: false
      role: string // string; wire null: false; omitempty: false
    }

    // instrument.created
    type InstrumentCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      holderId: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      accountId: string // string; wire null: false; omitempty: false
      type: string // string; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
      relatedParties: InstrumentRelatedPartyPayload[] // []InstrumentRelatedPartyPayload; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="instrument.deleted">
    **Event:** `studio.lerian.ledger.instrument.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the deletion of an instrument.

    **Subject:** instrument ID (`p.ID`)

    ```typescript theme={null}
    // instrument.deleted
    type InstrumentDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      holderId: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      deletionType: string // string; wire null: false; omitempty: false
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="instrument.related_party_deleted">
    **Event:** `studio.lerian.ledger.instrument.related_party_deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the removal of a single related party from an instrument (`ce-subject` is the instrument id).

    **Subject:** instrument ID (`p.InstrumentID`)

    ```typescript theme={null}
    // instrument.related_party_deleted
    type InstrumentRelatedPartyDeletedDataV1 = {
      instrumentId: string // string; wire null: false; omitempty: false
      holderId: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      relatedPartyId: string // string; wire null: false; omitempty: false
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="instrument.updated">
    **Event:** `studio.lerian.ledger.instrument.updated`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** An instrument's mutable fields change.

    **Subject:** instrument ID (`p.ID`)

    ```typescript theme={null}
    type InstrumentRelatedPartyPayload = {
      relatedPartyId: string // string; wire null: false; omitempty: false
      role: string // string; wire null: false; omitempty: false
    }

    // instrument.updated
    type InstrumentUpdatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      holderId: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      accountId: string // string; wire null: false; omitempty: false
      type: string // string; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
      relatedParties: InstrumentRelatedPartyPayload[] // []InstrumentRelatedPartyPayload; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="ledger.created">
    **Event:** `studio.lerian.ledger.ledger.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the creation of a ledger within an organization.

    **Subject:** ledger ID (`p.ID`)

    ```typescript theme={null}
    type LedgerStatusPayload = {
      code: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    // ledger.created
    type LedgerCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      name: string // string; wire null: false; omitempty: false
      status: LedgerStatusPayload // LedgerStatusPayload; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="ledger.deleted">
    **Event:** `studio.lerian.ledger.ledger.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the deletion of a ledger.

    **Subject:** ledger ID (`p.ID`)

    ```typescript theme={null}
    // ledger.deleted
    type LedgerDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="ledger.updated">
    **Event:** `studio.lerian.ledger.ledger.updated`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A ledger's name or status changes.

    **Subject:** ledger ID (`p.ID`)

    ```typescript theme={null}
    type LedgerStatusPayload = {
      code: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    // ledger.updated
    type LedgerUpdatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      name: string // string; wire null: false; omitempty: false
      status: LedgerStatusPayload // LedgerStatusPayload; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="operation_route.created">
    **Event:** `studio.lerian.ledger.operation_route.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.1.0`

    **Trigger:** the creation of an operation route.

    **Subject:** operation-route ID (`p.ID`)

    ```typescript theme={null}
    // operation_route.created
    type OperationRouteCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId?: string // string; wire null: false; omitempty: true
      title: string // string; wire null: false; omitempty: false
      description?: string // string; wire null: false; omitempty: true
      code?: string // string; wire null: false; omitempty: true
      operationType: string // string; wire null: false; omitempty: false
      account?: AccountRule // *mmodel.AccountRule; wire null: false; omitempty: true
      accountingEntries?: AccountingEntries // *mmodel.AccountingEntries; wire null: false; omitempty: true
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="operation_route.deleted">
    **Event:** `studio.lerian.ledger.operation_route.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.1.0`

    **Trigger:** the deletion of an operation route.

    **Subject:** operation-route ID (`p.ID`)

    ```typescript theme={null}
    // operation_route.deleted
    type OperationRouteDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId?: string // string; wire null: false; omitempty: true
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="operation_route.updated">
    **Event:** `studio.lerian.ledger.operation_route.updated`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.1.0`

    **Trigger:** An operation route's mutable fields change.

    **Subject:** operation-route ID (`p.ID`)

    ```typescript theme={null}
    // operation_route.updated
    type OperationRouteUpdatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId?: string // string; wire null: false; omitempty: true
      title: string // string; wire null: false; omitempty: false
      description?: string // string; wire null: false; omitempty: true
      code?: string // string; wire null: false; omitempty: true
      operationType: string // string; wire null: false; omitempty: false
      account?: AccountRule // *mmodel.AccountRule; wire null: false; omitempty: true
      accountingEntries?: AccountingEntries // *mmodel.AccountingEntries; wire null: false; omitempty: true
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="organization.created">
    **Event:** `studio.lerian.ledger.organization.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the creation of an organization.

    **Subject:** organization ID (`p.ID`)

    ```typescript theme={null}
    type OrganizationAddressPayload = {
      line1: string // string; wire null: false; omitempty: false
      line2: string | null // *string; wire null: true; omitempty: false
      zipCode: string // string; wire null: false; omitempty: false
      city: string // string; wire null: false; omitempty: false
      state: string // string; wire null: false; omitempty: false
      country: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    type OrganizationStatusPayload = {
      code: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    // organization.created
    type OrganizationCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      parentOrganizationId: string | null // *string; wire null: true; omitempty: false
      legalName: string // string; wire null: false; omitempty: false
      doingBusinessAs: string | null // *string; wire null: true; omitempty: false
      legalDocument: string // string; wire null: false; omitempty: false
      address: OrganizationAddressPayload // OrganizationAddressPayload; wire null: false; omitempty: false
      status: OrganizationStatusPayload // OrganizationStatusPayload; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="organization.deleted">
    **Event:** `studio.lerian.ledger.organization.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the deletion of an organization.

    **Subject:** organization ID (`p.ID`)

    ```typescript theme={null}
    // organization.deleted
    type OrganizationDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="organization.updated">
    **Event:** `studio.lerian.ledger.organization.updated`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** An organization's mutable fields change.

    **Subject:** organization ID (`p.ID`)

    ```typescript theme={null}
    type OrganizationAddressPayload = {
      line1: string // string; wire null: false; omitempty: false
      line2: string | null // *string; wire null: true; omitempty: false
      zipCode: string // string; wire null: false; omitempty: false
      city: string // string; wire null: false; omitempty: false
      state: string // string; wire null: false; omitempty: false
      country: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    type OrganizationStatusPayload = {
      code: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    // organization.updated
    type OrganizationUpdatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      parentOrganizationId: string | null // *string; wire null: true; omitempty: false
      legalName: string // string; wire null: false; omitempty: false
      doingBusinessAs: string | null // *string; wire null: true; omitempty: false
      address: OrganizationAddressPayload // OrganizationAddressPayload; wire null: false; omitempty: false
      status: OrganizationStatusPayload // OrganizationStatusPayload; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="portfolio.created">
    **Event:** `studio.lerian.ledger.portfolio.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the creation of a portfolio.

    **Subject:** portfolio ID (`p.ID`)

    ```typescript theme={null}
    type PortfolioStatusPayload = {
      code: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    // portfolio.created
    type PortfolioCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      name: string // string; wire null: false; omitempty: false
      entityId?: string // string; wire null: false; omitempty: true
      status: PortfolioStatusPayload // PortfolioStatusPayload; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="portfolio.deleted">
    **Event:** `studio.lerian.ledger.portfolio.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the deletion of a portfolio.

    **Subject:** portfolio ID (`p.ID`)

    ```typescript theme={null}
    // portfolio.deleted
    type PortfolioDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="portfolio.updated">
    **Event:** `studio.lerian.ledger.portfolio.updated`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A portfolio's mutable fields change.

    **Subject:** portfolio ID (`p.ID`)

    ```typescript theme={null}
    type PortfolioStatusPayload = {
      code: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    // portfolio.updated
    type PortfolioUpdatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      name: string // string; wire null: false; omitempty: false
      entityId?: string // string; wire null: false; omitempty: true
      status: PortfolioStatusPayload // PortfolioStatusPayload; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="segment.created">
    **Event:** `studio.lerian.ledger.segment.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the creation of a segment.

    **Subject:** segment ID (`p.ID`)

    ```typescript theme={null}
    type SegmentStatusPayload = {
      code: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    // segment.created
    type SegmentCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      name: string // string; wire null: false; omitempty: false
      status: SegmentStatusPayload // SegmentStatusPayload; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="segment.deleted">
    **Event:** `studio.lerian.ledger.segment.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the deletion of a segment.

    **Subject:** segment ID (`p.ID`)

    ```typescript theme={null}
    // segment.deleted
    type SegmentDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="segment.updated">
    **Event:** `studio.lerian.ledger.segment.updated`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A segment's mutable fields change.

    **Subject:** segment ID (`p.ID`)

    ```typescript theme={null}
    type SegmentStatusPayload = {
      code: string // string; wire null: false; omitempty: false
      description?: string // *string; wire null: false; omitempty: true
    }

    // segment.updated
    type SegmentUpdatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      name: string // string; wire null: false; omitempty: false
      status: SegmentStatusPayload // SegmentStatusPayload; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="transaction.canceled">
    **Event:** `studio.lerian.ledger.transaction.canceled`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A pending transaction transitions from `PENDING` to `CANCELED`.

    **Subject:** transaction ID (`p.ID`)

    ```typescript theme={null}
    // transaction.canceled
    type TransactionCanceledDataV1 = {
      id: string // string; wire null: false; omitempty: false
      parentTransactionId?: string // *string; wire null: false; omitempty: true
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      status: MmodelStatus // mmodel.Status; wire null: false; omitempty: false
      amount?: DecimalString // *decimal.Decimal; wire null: false; omitempty: true
      assetCode: string // string; wire null: false; omitempty: false
      chartOfAccountsGroupName?: string // string; wire null: false; omitempty: true
      description?: string // string; wire null: false; omitempty: true
      source?: string[] // []string; wire null: false; omitempty: true
      destination?: string[] // []string; wire null: false; omitempty: true
      route?: string // string; wire null: false; omitempty: true
      routeId?: string // *string; wire null: false; omitempty: true
      operations: JsonRawMessage[] // []json.RawMessage; wire null: false; omitempty: false
      metadata?: Record<string, unknown> // map[string]any; wire null: false; omitempty: true
      feesSkipped: boolean // bool; wire null: false; omitempty: false
      tracerSkipped: boolean // bool; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="transaction.committed">
    **Event:** `studio.lerian.ledger.transaction.committed`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A pending transaction transitions from `PENDING` to `APPROVED`.

    **Subject:** transaction ID (`p.ID`)

    ```typescript theme={null}
    // transaction.committed
    type TransactionCommittedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      parentTransactionId?: string // *string; wire null: false; omitempty: true
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      status: MmodelStatus // mmodel.Status; wire null: false; omitempty: false
      amount?: DecimalString // *decimal.Decimal; wire null: false; omitempty: true
      assetCode: string // string; wire null: false; omitempty: false
      chartOfAccountsGroupName?: string // string; wire null: false; omitempty: true
      description?: string // string; wire null: false; omitempty: true
      source?: string[] // []string; wire null: false; omitempty: true
      destination?: string[] // []string; wire null: false; omitempty: true
      route?: string // string; wire null: false; omitempty: true
      routeId?: string // *string; wire null: false; omitempty: true
      operations: JsonRawMessage[] // []json.RawMessage; wire null: false; omitempty: false
      metadata?: Record<string, unknown> // map[string]any; wire null: false; omitempty: true
      feesSkipped: boolean // bool; wire null: false; omitempty: false
      tracerSkipped: boolean // bool; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="transaction.posted">
    **Event:** `studio.lerian.ledger.transaction.posted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** the commit of a newly created transaction to storage with all its operations persisted (no parent).

    **Subject:** transaction ID (`p.ID`)

    ```typescript theme={null}
    // transaction.posted
    type TransactionPostedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      parentTransactionId?: string // *string; wire null: false; omitempty: true
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      status: MmodelStatus // mmodel.Status; wire null: false; omitempty: false
      amount?: DecimalString // *decimal.Decimal; wire null: false; omitempty: true
      assetCode: string // string; wire null: false; omitempty: false
      chartOfAccountsGroupName?: string // string; wire null: false; omitempty: true
      description?: string // string; wire null: false; omitempty: true
      source?: string[] // []string; wire null: false; omitempty: true
      destination?: string[] // []string; wire null: false; omitempty: true
      route?: string // string; wire null: false; omitempty: true
      routeId?: string // *string; wire null: false; omitempty: true
      operations: JsonRawMessage[] // []json.RawMessage; wire null: false; omitempty: false
      metadata?: Record<string, unknown> // map[string]any; wire null: false; omitempty: true
      feesSkipped: boolean // bool; wire null: false; omitempty: false
      tracerSkipped: boolean // bool; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="transaction.reverted">
    **Event:** `studio.lerian.ledger.transaction.reverted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A revert flow creates a child transaction. `parentTransactionId` correlates it to the original.

    **Subject:** transaction ID (`p.ID`)

    ```typescript theme={null}
    // transaction.reverted
    type TransactionRevertedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      parentTransactionId?: string // *string; wire null: false; omitempty: true
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId: string // string; wire null: false; omitempty: false
      status: MmodelStatus // mmodel.Status; wire null: false; omitempty: false
      amount?: DecimalString // *decimal.Decimal; wire null: false; omitempty: true
      assetCode: string // string; wire null: false; omitempty: false
      chartOfAccountsGroupName?: string // string; wire null: false; omitempty: true
      description?: string // string; wire null: false; omitempty: true
      source?: string[] // []string; wire null: false; omitempty: true
      destination?: string[] // []string; wire null: false; omitempty: true
      route?: string // string; wire null: false; omitempty: true
      routeId?: string // *string; wire null: false; omitempty: true
      operations: JsonRawMessage[] // []json.RawMessage; wire null: false; omitempty: false
      metadata?: Record<string, unknown> // map[string]any; wire null: false; omitempty: true
      feesSkipped: boolean // bool; wire null: false; omitempty: false
      tracerSkipped: boolean // bool; wire null: false; omitempty: false
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="transaction_group.canceled">
    **Event:** `studio.lerian.ledger.transaction_group.canceled`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A pending cross-ledger group is canceled.

    **Subject:** group ID (`p.GroupID`)

    ```typescript theme={null}
    // transaction_group.canceled
    type TransactionGroupCanceledDataV1 = {
      groupId: string // string; wire null: false; omitempty: false
      revertedGroupId?: string // *string; wire null: false; omitempty: true
      status: string // string; wire null: false; omitempty: false
      assetCode: string // string; wire null: false; omitempty: false
      ledgerCount: number // int; wire null: false; omitempty: false
      parts: TransactionGroupPart[] // []events.TransactionGroupPart; wire null: false; omitempty: false
      occurredAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="transaction_group.committed">
    **Event:** `studio.lerian.ledger.transaction_group.committed`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A pending cross-ledger group is committed.

    **Subject:** group ID (`p.GroupID`)

    ```typescript theme={null}
    // transaction_group.committed
    type TransactionGroupCommittedDataV1 = {
      groupId: string // string; wire null: false; omitempty: false
      revertedGroupId?: string // *string; wire null: false; omitempty: true
      status: string // string; wire null: false; omitempty: false
      assetCode: string // string; wire null: false; omitempty: false
      ledgerCount: number // int; wire null: false; omitempty: false
      parts: TransactionGroupPart[] // []events.TransactionGroupPart; wire null: false; omitempty: false
      occurredAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="transaction_group.posted">
    **Event:** `studio.lerian.ledger.transaction_group.posted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A direct cross-ledger transaction completes. `parts` lists the transactions in the group.

    **Subject:** group ID (`p.GroupID`)

    ```typescript theme={null}
    // transaction_group.posted
    type TransactionGroupPostedDataV1 = {
      groupId: string // string; wire null: false; omitempty: false
      revertedGroupId?: string // *string; wire null: false; omitempty: true
      status: string // string; wire null: false; omitempty: false
      assetCode: string // string; wire null: false; omitempty: false
      ledgerCount: number // int; wire null: false; omitempty: false
      parts: TransactionGroupPart[] // []events.TransactionGroupPart; wire null: false; omitempty: false
      occurredAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="transaction_group.reverted">
    **Event:** `studio.lerian.ledger.transaction_group.reverted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.0.0`

    **Trigger:** A cross-ledger group is reverted. `groupId` names the new group and `revertedGroupId` names the original.

    **Subject:** group ID (`p.GroupID`)

    ```typescript theme={null}
    // transaction_group.reverted
    type TransactionGroupRevertedDataV1 = {
      groupId: string // string; wire null: false; omitempty: false
      revertedGroupId?: string // *string; wire null: false; omitempty: true
      status: string // string; wire null: false; omitempty: false
      assetCode: string // string; wire null: false; omitempty: false
      ledgerCount: number // int; wire null: false; omitempty: false
      parts: TransactionGroupPart[] // []events.TransactionGroupPart; wire null: false; omitempty: false
      occurredAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="transaction_route.created">
    **Event:** `studio.lerian.ledger.transaction_route.created`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.1.0`

    **Trigger:** the creation of a transaction route.

    **Subject:** transaction-route ID (`p.ID`)

    ```typescript theme={null}
    // transaction_route.created
    type TransactionRouteCreatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId?: string // string; wire null: false; omitempty: true
      title: string // string; wire null: false; omitempty: false
      description?: string // string; wire null: false; omitempty: true
      operationRouteIds?: string[] // []string; wire null: false; omitempty: true
      createdAt: string // string; wire null: false; omitempty: false
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="transaction_route.deleted">
    **Event:** `studio.lerian.ledger.transaction_route.deleted`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.1.0`

    **Trigger:** the deletion of a transaction route.

    **Subject:** transaction-route ID (`p.ID`)

    ```typescript theme={null}
    // transaction_route.deleted
    type TransactionRouteDeletedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId?: string // string; wire null: false; omitempty: true
      deletedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>

  <Accordion title="transaction_route.updated">
    **Event:** `studio.lerian.ledger.transaction_route.updated`

    **Topic:** `lerian.streaming.ledger`

    **Route DLQ:** `lerian.streaming.ledger.dlq`

    **Schema:** `1.1.0`

    **Trigger:** A transaction route's mutable fields change.

    **Subject:** transaction-route ID (`p.ID`)

    ```typescript theme={null}
    // transaction_route.updated
    type TransactionRouteUpdatedDataV1 = {
      id: string // string; wire null: false; omitempty: false
      organizationId: string // string; wire null: false; omitempty: false
      ledgerId?: string // string; wire null: false; omitempty: true
      title: string // string; wire null: false; omitempty: false
      description?: string // string; wire null: false; omitempty: true
      operationRouteIds?: string[] // []string; wire null: false; omitempty: true
      updatedAt: string // string; wire null: false; omitempty: false
    }
    ```
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.