Skip to main content
To turn a payment rail into a product, you manage fees, split revenue, and keep a clear audit trail for every transaction. You combine Midaz (the ledger), the Pix Plugin (Pix application orchestration), and the Fees Engine (automated fee logic, part of Midaz). Together they provide Pix operations with fee management and ledger postings in the same platform.

What each component does


Each component solves a specific layer of the problem: Together, these three parts connect the Pix application flow, fee calculation, and ledger postings. Validate the exact fee behavior and posting shape against the Fees Engine contract for your deployment.

Choosing your Pix participation model


The Pix Plugin’s application contract is designed for both participation models defined by BACEN. The fee integration and ledger flow on this page apply to both.
Indirect Pix via BTG is production-ready. Your institution connects through BTG’s infrastructure, so you skip ISPB certification and direct BACEN connectivity.Direct Pix via JD: explore its capabilities in the direct participation guide.
For a detailed comparison, see Pix participation models.

Fintech launching Pix with automated fees


A fintech plans to offer Pix to its customers. It wants to charge a flat fee on every incoming Pix (cash-in). The fee covers operational costs and adds revenue without extra complexity for the customer. The fee logic and ledger structure stay the same for both models. This holds whether the fintech is an indirect participant (via BTG) or a direct participant (via JD).

The business goal

  • Offer instant Pix payments to end customers
  • Charge a transparent, configurable fee on incoming transfers
  • Record every fee in the ledger for compliance and financial reporting
  • Launch quickly, without custom fee logic or reconciliation pipelines

Setting up with Midaz

The fintech first structures its Midaz environment:
1

Create the Organization

Register the fintech as an Organization in Midaz. This is the top-level entity that owns all ledgers, accounts, and transactions.
2

Set up the Ledger

Create a Ledger to track all customer transactions and fee movements. The Pix Plugin and the Fees Engine share this ledger.
3

Define the Asset

Register BRL as the operating asset. All Pix transactions and fee calculations use this asset.
4

Create customer accounts

Each customer gets an account under the ledger. These accounts receive Pix credits and follow the fee rules.
5

Create fee destination accounts

Set up internal accounts to receive fee credits, for example a “Pix Fee Revenue” account. The Fees Engine package configuration references these accounts.
6

Organize with Segments

Use Segments to group customers by tier (e.g., Standard, Premium). This lets you apply different fee packages to different groups.

Configuring the Fees Engine

With the ledger structure in place, the fintech configures a fee package:
  • Fee type: Flat fee of R$ 1.50 per incoming Pix
  • Scope: Applied to all cash-in transactions on the main ledger
  • Routing: The Fees Engine routes fee credits to the “Pix Fee Revenue” internal account
  • Exemptions: Add Premium-tier accounts to the waived accounts list
The Fees Engine supports multiple calculation methods: flat fees, percentage-based fees, or a “max between” rule that applies whichever is greater. For this scenario, a flat fee keeps pricing predictable for customers.
You configure fee packages once, and the Fees Engine applies them automatically. When a Pix transaction matches the package criteria (ledger, segment, amount range), the Fees Engine calculates and routes the fee without any manual step.
An account with an active account plan is charged by its plan, not by the fee packages, on a Pix it sends, and only when a fee of the plan matches the Pix.

How a transaction flows

When a customer receives a Pix transfer, here is what happens:
1

Pix arrives

The sending institution initiates a Pix. Your connectivity provider (BTG for indirect, JD for direct) receives the transaction and notifies the Pix Plugin.
2

Transaction is validated

The plugin validates the recipient: it checks that the account exists, is active, and can receive funds. The plugin also checks CRM data and the Pix key validity.
3

Settlement begins

After the plugin confirms the transaction, settlement starts. The plugin fetches the destination account details from Midaz.
4

Fees are calculated automatically

The Fees Engine evaluates the transaction against available fee packages. It finds a matching package and calculates the R$ 1.50 flat fee.
5

Ledger records the full picture

Midaz records the transaction with the fee distribution in a single operation:
  • Midaz credits the customer’s account with the net amount (gross minus fee).
  • Midaz credits the fee destination account with R$ 1.50.
  • Every movement is traceable, with double-entry precision.
6

Transaction is complete

The customer sees the Pix credit in their account. The ledger records the fee for reporting and reconciliation.

What the fintech gets

  • No custom fee logic: the Fees Engine handles calculation, routing, and exemptions.
  • Accurate ledger: every fee is a ledger entry. Auditors see the same numbers your finance team sees.
  • Customer segmentation: the Fees Engine exempts Premium customers automatically through waived accounts.
  • Fee flexibility: change fee values, add percentage-based fees, or introduce amount-based thresholds without changes to your transaction pipeline.

What you need to get started


To run this setup, your institution needs:
The Pix Plugin and the Fees Engine require a valid Lerian license. The Fees Engine falls under the Midaz Enterprise tier. For license details, see the License documentation.

Estimating before going live


Before you process real transactions, use the Fees Engine estimate to check your fee configuration. The estimate lets you:
  • Preview the exact fee for a given transaction amount
  • Check that exemptions work as expected
  • Confirm proportional splits produce the correct distribution
  • Test edge cases like boundary amounts and waived accounts
This helps most during onboarding, before you set final fee structures with business stakeholders.
Use the Estimate Transaction Fees endpoint to test specific fee packages without writing to the ledger.

Next steps


Fees Engine overview

Understand fee packages, calculation rules, and routing options.

Using Fees Engine

Step-by-step guide to creating packages and processing fees.

Direct vs. Indirect Pix

Compare participation models and choose the right connectivity path.

Pix Lerian

Explore the unified interface for payments, keys, collections, and refunds.