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.
This page is intended for developers and database administrators. It contains detailed database schemas and table structures. If you’re looking for a business-level overview of Midaz’s entities and how they relate to each other, see About Midaz .
Explore the core tables and schemas that power Midaz. This reference helps developers and database administrators understand how data is structured and connected across the system. As Midaz evolves, new fields and tables may be added.
Tables
Each table is structured to support efficient querying and data integrity, aligning with Midaz’s commitment to scalability and flexibility.
Table: organization
Column Type Description id uuidThe unique identifier of the Organization. legalName textThe legal name of the Organization. parentOrganizationId uuidThe unique identifier of the parent Organization. doingBusinessAs textThe trade name of the Organization. legalDocument textThe document of the Organization. status jsonbInformation about the status. address jsonbInformation about the address of the Organization. metadata jsonbKey-value pairs to add as metadata. createdAt timestamptzTimestamp of creation (UTC). updatedAt timestamptzTimestamp of last update (UTC). deletedAt timestamptzThe timestamp of soft deletion, if applicable (UTC).
Table: ledger
Column Type Description id uuidThe unique identifier of the Ledger. organizationId uuidThe unique identifier of the Organization. name textThe name of the Ledger. status jsonbInformation about the status. metadata jsonbKey-value pairs to add as metadata. createdAt timestamptzTimestamp of creation (UTC). updatedAt timestamptzTimestamp of last update (UTC). deletedAt timestamptzTimestamp of soft deletion, if applicable (UTC).
Table: asset
Column Type Description id uuidThe unique identifier of the Asset. organizationId uuidThe unique identifier of the Organization. ledgerId uuidThe unique identifier of the Ledger. name textThe name of the Asset. type enumThe type of Asset (currency, crypto, commodity, others). code textThe code used to refer to the Asset. status textInformation about the status. metadata jsonbKey-value pairs to add as metadata. createdAt timestamptzTimestamp of creation (UTC). updatedAt timestamptzTimestamp of last update (UTC). deletedAt timestamptzTimestamp of soft deletion, if applicable (UTC).
Table: account-type
Column Type Description id uuidThe unique identifier of the Account Type. ledgerId uuidThe unique identifier of the Ledger. name textName of the Account Type. description textDescription of the Account Type. keyValue textCustom value defined by the user to identify the Account Type. createdAt timestamptzTimestamp of creation (UTC). updatedAt timestamptzTimestamp of last update (UTC). deletedAt timestamptzTimestamp of soft deletion, if applicable (UTC).
Table: account
Column Type Description id uuidThe unique identifier of the Account. organizationId uuidThe unique identifier of the Organization. ledgerId uuidThe unique identifier of the Ledger. assetCode textThe code used to refer to the Asset. name textThe name of the Account. alias textA unique, user-friendly identifier for the account. type textThe type of account. parentAccountId uuidThe unique identifier of the Parent Account. entityId textThe unique identifier of the Entity responsible for the Account. portfolioId uuidThe unique identifier of the Portfolio. segmentId uuidThe unique identifier of the Segment. status jsonbInformation about the status. metadata jsonbKey-value pairs to add as metadata. createdAt timestamptzTimestamp of creation (UTC). updatedAt timestamptzTimestamp of last update (UTC). deletedAt timestamptzTimestamp of soft deletion, if applicable (UTC).
Table: portfolio
Column Type Description id uuidThe unique identifier of the Portfolio. organizationId uuidThe unique identifier of the Organization. ledgerId uuidThe unique identifier of the Ledger. entityId textThe unique identifier of the user responsible for the Portfolio. name textThe name of the Portfolio. status jsonbInformation about the status. metadata jsonbKey-value pairs to add as metadata. createdAt timestamptzTimestamp of creation (UTC). updatedAt timestamptzTimestamp of last update (UTC). deletedAt timestamptzTimestamp of soft deletion, if applicable (UTC).
Table: segment
Column Type Description id uuidThe unique identifier of the Segment. organizationId uuidThe unique identifier of the Organization. ledgerId uuidThe unique identifier of the Ledger. name textThe name of the Segment. status jsonbInformation about the status. metadata jsonbKey-value pairs to add as metadata. created_at timestamptzTimestamp of creation (UTC). updated_at timestamptzTimestamp of last update (UTC). deleted_at timestamptzTimestamp of soft deletion, if applicable (UTC).
Table: balance
Column Type Description id textThe unique identifier of the Balance. organizationId uuidThe unique identifier of the Organization. ledgerId uuidThe unique identifier of the Ledger. accountId uuidThe unique identifier of the Account. alias textThe alias for the account used in the operation. assetCode textThe code used to refer to the Asset. available textPrevious available balance. onHold textAmount on hold/reserved. version integerBalance version, which is updated with each transaction. accountType textThe type of account. allowSending booleanIf true, indicates that sending transactions is permitted. allowReceiving booleanIf true, indicates that receiving transactions is permitted. createdAt timestamptzTimestamp of creation (UTC). updatedAt timestamptzTimestamp of last update (UTC). deletedAt timestamptzTimestamp of soft deletion, if applicable (UTC).
Table: operation-route
Column Type Description id uuidThe unique identifier of the Operation Route. organizationId uuidThe unique identifier of the Organization. ledgerId uuidThe unique identifier of the Ledger. title textShort text summarizing the purpose of the operation. Used as an entry note for identification. description textDetailed description of the Operation Route purpose and usage. type textThe type of operation (debit/credit). account jsonbDefines the rule for selecting the account that will participate in the operation (debit or credit). createdAt timestamptzTimestamp of creation (UTC). updatedAt timestamptzTimestamp of last update (UTC). deletedAt timestamptzTimestamp of soft deletion, if applicable (UTC).
Table: operation
Column Type Description id uuidThe unique identifier of the Transaction Route. transactionId uuidThe unique identifier of the Transaction. organizationId uuidThe unique identifier of the Organization. ledgerId uuidThe unique identifier of the Ledger. accountId uuidThe unique identifier of the account of which you want to retrieve the balances. balanceId uuidThe unique identifier of the Balance. accountAlias textThe alias for the account used in the operation. description textDescription of the transaction. type textThe type of the operation (debit or credit). assetCode textThe name of the asset used in the operation. chartOfAccounts text[Deprecated] The name of the Chart-of-Accounts that the operation belongs to.route textThe chart of accounts group name that categorizes the operation under a specific group. amount jsonbAn object containing information about the amount used in the operation. balance jsonbAn object containing information about the balance before the operation. balanceAfter jsonbAn object containing information about the balance after the operation. status jsonbThe transaction status (pending, completed, reversed). metadata jsonbKey-value pairs to add as metadata. createdAt timestamptzTimestamp of creation (UTC). updatedAt timestamptzTimestamp of last update (UTC). deletedAt timestamptzTimestamp of soft deletion, if applicable (UTC).
Deprecated field — This field is still present for backward compatibility but should no longer be used.
Table: transaction-route
Column Type Description id uuidThe unique identifier of the Transaction Route. organizationId uuidThe unique identifier of the Organization. ledgerId uuidThe unique identifier of the Ledger. title textShort text summarizing the purpose of the transaction. Used as an entry note for identification. description textA description for the Transaction Route. operationRoutes arrayA list of Operation Route IDs that define the debit and credit logic for the transaction. metadata objectKey-value pairs to add as metadata. createdAt timestamptzTimestamp of creation (UTC). updatedAt timestamptzTimestamp of last update (UTC). deletedAt timestamptzTimestamp of soft deletion, if applicable (UTC).
Table: transaction
Column Type Description id uuidThe unique identifier of the transaction. organizationId uuidThe unique identifier of the Organization. ledgerId uuidThe unique identifier of the Ledger. description textDescription of the transaction. route textThe chart of accounts group name that categorizes the operation under a specific group. status jsonbInformation about the status. amount textThe sent amount. assetCode textThe code used to refer to the Asset. chartOfAccountsGroupName text[Deprecated] The name of the group used to categorize the operations of a transaction under the same group.source arrayThe list of accounts used as source. destination arrayThe list of accounts used as destination. operations arrayThe list of operations in the transaction. metadata jsonbKey-value pairs to add as metadata. createdAt timestamptzTimestamp of creation (UTC). updatedAt timestamptzTimestamp of last update (UTC). deletedAt timestamptzTimestamp of soft deletion, if applicable (UTC).
Deprecated field — This field is still present for backward compatibility but should no longer be used.
Data model
In Figure 1 , you can find a visual representation of the core tables in Midaz and their relationships. The diagram helps developers and DB administrators understand how the different entities are interconnected within the system, serving as a guide for efficient data handling and integration.