Skip to main content

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.

Account Types in Midaz allow you to systematically classify accounts according to your organization’s financial structure needs. These classifications define the nature and purpose of accounts within your ledger design, enabling proper transaction routing and operational validation across different account categories. Account Types can be customized via the Account Types API to match your specific business requirements and financial workflows, providing the foundation for structured transaction processing while maintaining data integrity.

Enabling Account Type validation

Account Type validation is enabled per-ledger through the Ledger Settings API. To activate it, send a PATCH request to the Ledger Settings endpoint:
{
  "accounting": {
    "validateAccountType": true
  }
}
Settings changes take effect immediately — no redeployment required. You can update them at any time via the API.

Behavior of the type field in Accounts API

When creating an Account, the type field behavior adapts based on the activation of the Account Type Validation feature:
  • Account Type Validation Disabled (Default): The type field is optional and accepts any free-form string.
  • Account Type Validation Enabled: The type field becomes mandatory and must match one of the Account Types previously registered via the Account Types API. If an invalid or non-registered type is submitted, the system will return a validation error.
If your organization is enabling the Account Type Validation feature, we recommend reviewing existing accounts. You may need to either recreate them or retroactively assign the appropriate Account Type to align with your accounting structure.
This dynamic ensures that every account aligns with the formal accounting categories required by your business, strengthening governance and financial reporting.

The keyValue field

The keyValue field identifies an Account Type and has the following constraints:
  • Immutable: keyValue is set at creation time and cannot be changed afterward. The Update Account Type endpoint does not accept this field.
  • Unique per ledger: Each keyValue must be unique within a given ledger.
  • Used for type validation: When validateAccountType is enabled in Ledger Settings, the type field of any Account must exactly match one of the registered keyValue strings. Accounts created with an unregistered type value will be rejected.

Managing Account Types



You can manage your Account Types exclusively via API.