Skip to main content
Account Types classify the accounts in your ledger. Each Account Type has a name, a description, and a unique key value. You register the Account Types that match your accounting structure. When you enable Account Type validation, the ledger checks the type field of every new non-external Account against these registered types.

How Account Type validation works

Enabling Account Type validation

You enable Account Type validation per ledger through the Ledger Settings API. Send a PATCH request to the Ledger Settings endpoint:
Settings changes take effect immediately — no redeployment required. You can update them at any time through the API.

Behavior of the type field in Accounts API

When you create an Account, the type field behavior depends on the validation setting:
  • Validation disabled (default): You must provide a type. It accepts any string value up to 256 characters. The ledger does not compare it to registered Account Types.
  • Validation enabled: The type field must match the keyValue of a registered Account Type. Midaz stores new keyValue values in lowercase and compares the value case-insensitively. Use lowercase values in requests and configuration. If it does not match, the ledger rejects the account with a validation error. External accounts skip this check.
Before you enable Account Type validation, review your existing accounts. The type field of an existing Account cannot be changed, so create a matching registered Account Type or recreate an Account whose type must change.

The keyValue field

The keyValue field identifies an Account Type. It has these constraints:
  • Immutable: You set keyValue when you create the Account Type. You cannot change it afterward. The Update Account Type endpoint does not accept this field.
  • Unique per ledger: Each keyValue must be unique within a ledger.
  • Used for validation: When you enable validateAccountType in Ledger Settings, the ledger compares the type field of each non-external Account case-insensitively with a registered keyValue. The ledger rejects any non-external Account with an unregistered type.

Managing Account Types


You manage Account Types through the API or the Lerian Console.
See also
  • Transaction Routing — Operation Routes use ruleType: account_type to validate an account’s type against the route’s configured account.validIf values.
  • Accounting Entries — How Midaz resolves debit and credit rubrics for the accounts these types classify.