Skip to main content
This guide explains how to transform Midaz account operations into end-user account statements. You build an account statement from Midaz account operations. Each operation is a ledger movement that links to an account, such as a credit, debit, hold, release, or overdraft event. To build a statement, retrieve the account operations for the period. Keep the operations that affect the statement view. Then transform each operation into a row that users understand.
Account balance flow

Account balance flow

1

Retrieve account operations

Use the List Operations by Account endpoint to list operations for a specific account:
2

Apply query filters

Use query parameters to define the statement period, control pagination, and filter the operations that the endpoint returns.

Required for statement queries

You need these fields for this statement use case. They define the statement window and make the result predictable for users.

Required for pagination

Optional filters

The endpoint can return the following operation types:Use type to classify the accounting movement. Use direction to decide whether the statement shows the amount as positive or negative.Example request:
3

Transform operations into statement entries

Each object in the items array can become one statement row.

Required for statement rendering

You need these fields to render a useful statement row. The API does not require all of them. A statement without them loses meaning, traceability, or balance context.Midaz returns the ledger movement. The integrating system should add business context in the metadata of each relevant source.from[] and distribute.to[] entry when it creates the transaction; metadata does not propagate from source entries to destination entries.Example transformation:
4

Apply statement display rules

Use direction to determine the sign

Do not use type to determine whether the value is positive or negative. The type field classifies the accounting movement, while direction defines whether the value enters or leaves the account.

Handle hold and release operations separately

Do not display operations with the following types as regular settled movements:
  • ON_HOLD
  • RELEASE
Instead:
  • ON_HOLD should appear as a balance hold or temporary lock
  • RELEASE should appear as a balance release or unlock

Define a settled-operation policy

Do not use balanceAffected as a settled-operation predicate. A normal ON_HOLD operation can set balanceAffected to true without changing the available balance. Define your statement policy explicitly from operation type and status, and show ON_HOLD and RELEASE according to the hold/release rules above.
5

Handle pagination

The endpoint splits responses into pages according to the limit value.To retrieve all operations:
  1. Read the next_cursor field from the response
  2. Send it as the cursor parameter in the next request
  3. Repeat until the response no longer returns next_cursor
Example flow:

Example statement output

After you apply filters, transform operations, and apply display rules, the final statement can look like this: The API does not return a ready-made statement page. It returns ledger events that the integrating system turns into a statement experience.

Add business context

The operations endpoint returns accounting events. A user-facing statement needs more context than the ledger movement alone. Send business metadata in each operation’s metadata when you create the transaction. Midaz stores those fields with that operation. The statement can use them later to show who, what, and why behind the movement.
  • counterparty
  • document
  • pixKey
  • endToEndId
  • channel
  • category
Example metadata:
This lets you display entries such as:
  • “Pix received from John Doe”
  • “Card purchase at Coffee Shop”
  • “Transfer to Savings Account”
instead of generic accounting descriptions. If the integrating system does not send these fields, the statement still works. It can then only display the accounting data that the operation returns.
Midaz keeps the ledger consistent and auditable. The integrating system adds business context to each operation’s metadata.