Operations

An Operation is the smallest unit of financial activity in Midaz – essentially a single ledger entry, which is either a debit or a credit on a specific account.

Operations are the building blocks of transactions. Every transaction is composed of two or more operations (Figure 1). Each operation records a change in the balance of one account:

  • A Debit operation decreases an account’s balance (for asset accounts that normally have positive balances) or represents value outflow from that account.
  • A Credit operation increases an account’s balance or represents value inflow into that account.
The image shows a simple flowchart representing a financial transaction of transferring BRL 1,000.00. It is enclosed in a rectangle labeled "Transfer Transaction BRL 1,000.00" and contains two operations: a red "Debit Operation" box on the left with the text "@source_account - BRL 1,000.00," and a green "Credit Operation" box on the right with the text "@destination_account + BRL 1,000.00." An arrow points from the debit operation to the credit operation, indicating the flow of the transaction.

Figure 1. Example of the Operations in a transaction to transfer BRL 1.000,00.

If we break down a transaction, it’s a collection of operations that together must net to zero from the ledger’s perspective. For example, a P2P payment with a fee might include:

  • a $100 debit from the sender’s account.
  • a $98 credit to the recipient’s account.
  • a $2 credit to the platform’s fee account.

Midaz guarantees that transactions always balance before they are committed.

Operations also carry metadata such as timestamps and references to the transaction they belong to. In Midaz's API or DSL, when creating a transaction, you must specify a set of operations, each with an amount, asset, source/destination account, and so on, and the system validates that they balance out before committing.

Key characteristics

  • Each operation belongs to a transaction and references a specific account and asset.
  • Operations include metadata like amount, type (debit/credit), timestamps, references, and more.
  • Operations are created when you initiate a transaction and populated with the data you provide.
  • Midaz validates all operations against configured rules before committing them to the ledger.

Operation Routes

With Transaction Routing, the execution of an operation now connects to structured validation logic — and that's where Operation Routes come in.

What is an Operation Route?

An Operation Route is a validation rule that defines which account types or specific accounts should be used in a transaction component, along with the accounting direction (source/destination) and descriptive annotation.

It works as a validation layer between transaction input and ledger structure, ensuring each operation submitted by users meets the predefined account requirements and business rules.

📘

Note

In short: Transactions contain multiple Operations. Operation Routes validate each Operation against the configured validation rules.

Operation > Operation Route relationship

When a transaction is submitted to Midaz, it contains multiple Operations. With Account Types & Transaction Routing enabled, each of these operations is validated against the rules defined in the Operation Routes to ensure:

  • The specified account matches the expected account type or specific account requirement.
  • The operation direction (debit/credit) aligns with the route definition.

This adds a powerful layer of validation, consistency, and integrity to transaction processing — especially when dealing with structured financial requirements.

❗️

Important

If the submitted operations don't match the configured Operation Route requirements, the transaction will fail validation and be rejected.

Managing Operations


Midaz automatically generates operations as part of a transaction flow. You can’t create them directly, but you can view and update them as needed.

View Operation details

Edit an Operation