BalanceUpdatedEvent (v1.0.0)

Event emitted when account balances are updated after transaction posting or other operations

BalanceUpdatedEvent

Published when account balances are updated with new postings after a balance reset has occurred.

Schema

schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "BalanceUpdatedEvent",
"description": "Event emitted when account balances are updated after transaction posting or other operations",
"properties": {
"accountId": {
"type": "object",
"description": "Account identifier",
"properties": {
"value": {
"type": "string",
"format": "uuid",
"description": "The unique account UUID"
}
},
"required": ["value"]
},
"balanceUpdates": {
"type": "array",
"description": "List of balance updates for different account types",
"items": {
"type": "object",
"properties": {
"accountDefinitionId": {
"type": "integer",
"description": "Account definition identifier"
},
"accountDefinitionName": {
"type": "string",
"description": "Account definition name"
},
"previousBalance": {
"type": "integer",
"description": "Previous balance amount (in smallest currency unit, e.g., 100 = 1.00)"
},
"newBalance": {
"type": "integer",
"description": "New balance amount (in smallest currency unit, e.g., 100 = 1.00)"
},
"change": {
"type": "integer",
"description": "Balance change amount (in smallest currency unit, e.g., 100 = 1.00)"
}
},
"required": ["accountDefinitionId", "accountDefinitionName", "previousBalance", "newBalance", "change"]
}
},
"currency": {
"type": "string",
"pattern": "^[A-Z]{3}$",
"description": "Currency of the balances (ISO 4217)",
"example": "EUR"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "Timestamp when the balances were updated"
}
},
"required": ["accountId", "balanceUpdates", "currency", "timestamp"],
"additionalProperties": false
}

Purpose

This event is used to update account balances when the account is in a reset state, ensuring that transactions posted after a balance reset are properly reflected in the account balances.

Key Attributes

  • Aggregate ID: Merchant account aggregate identifier
  • Postings: List of postings to apply to account balances

Business Impact

  • Maintains accurate balance tracking after balance resets
  • Ensures transaction integrity during balance reset periods
  • Supports proper accounting when balances have been cleared