Fee Engine
Fee Engine is built to give you complete control over how fees are applied, calculated, and tracked—across industries like finance, logistics, agribusiness, healthcare, and beyond. It brings transparency, automation, and precision to every fee-related transaction, storing them in dedicated client ledgers to ensure accountability and traceability at every step.
Why Use Fee Engine?
The Fee Engine plugin helps you manage complex fee logic with ease. Whether you're applying a flat rate, distributing fees proportionally, or simulating transactions in advance, this plugin is built for flexibility and scale.
Here’s what it unlocks:
- Flexible fee configuration via fee packages—tailored to account groups or specific ledgers
- Multiple calculation methods: flat fees, percentual rates, and “max between types” logic
- Proportional fee distribution for marketplace flows and multi-account operations
- Simulation tools to preview calculations before executing transactions
- Customizable fee-free ranges and account-based configurations
- Priority-based application to control the order in which multiple fees are applied
What Are Fees?
Fees are monetary values charged in exchange for services, products, or access. Their purpose depends on the industry, but the need for clarity and consistency is universal. Below are just a few examples:
Finance
In the financial sector, fees are applied to cover operational costs and ensure legal compliance.
- Account maintenance fee: Covers the cost of maintaining and managing bank accounts.
- Transfer fee: Covers the cost of performing transfers, such as TEDs or international transfers.
Logistics and Transportation
In the logistics sector, fees are related to the use of transportation and storage services.
- Handling fee: Covers the cost of moving goods in warehouses or during transportation.
- Unloading fee: Covers the cost of unloading goods at ports or terminals.
Pharmaceutical and Healthcare
In the pharmaceutical sector, fees aim to ensure the quality and regulation of services.
- Medication registration fee: Covers the cost of approval and registration of medications with regulatory authorities.
- Laboratory analysis fee: Covers the costs of analysis and quality control of pharmaceutical products.
Agricultural
In the agricultural sector, fees are linked to commercialization and regulatory processes.
- Sanitary inspection fee: Covers the costs of inspecting and certifying agricultural and livestock products.
- Agricultural export fee: Covers the administrative and regulatory costs for exporting agricultural products.
Fee Packages
A Fee Package is a configurable structure that defines how fees are calculated and applied in banking operations. Packages can be customized by account group or use case, making them ideal for organizations that require differentiated treatment across customer segments or product types.
Key parameters:
- Chart of accounts – Which accounts are involved and how they’re configured
- Segment – The group of accounts affected by the fee logic
- Ledger – Where the transactions are tracked and fee rules applied
Package Validations
To ensure integrity, some rules apply when setting up a Fee Package:
- Priority must be unique. You can’t assign the same priority to more than one fee.
- Priority 1 fees must always use
OriginalAmount
as thereferenceAmount
. - The
organizationId
,ledgerId
, andcreditAccount
fields must exist in Midaz before you create a package. You can verify them using the Retrieve an Account by Alias endpoint.
Routing Fees
Each calculated fee is routed to the appropriate creditAccount
as defined in the rule configuration—ensuring that values flow correctly through your accounting structure.
Soft Delete for Safe Recordkeeping
No data gets lost. When a resource is deleted:
- It’s marked with a
deletedAt
timestamp - It’s excluded from standard queries—but still stored for audit and historical accuracy
This ensures full traceability if needed.
Integrations
You can use Fee Engine on its own or alongside other components in your stack. It integrates seamlessly with Lerian plugins or your own implementation to apply fees based on your unique business logic.
Popular use cases include:
- Exchange engines
- Lending platforms
- Bill payment systems
- Smart contracts
- Pix (Brazil’s instant payment platform)
Attention
Fee Engine is available for clients using the Enterprise model. If you'd like to learn more or evaluate it for your use case, get in touch with our team.
Updated about 18 hours ago