> ## 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.

# Managing Fee Packages

> Browse, create, edit, and delete Fee Packages from the Midaz Console to control how flat, percentage, and combined charges apply to matching Transactions.

**Fee Packages** are the base unit of the [Fees Engine](/en/midaz/fees/console/fees-engine-overview). Each package defines a set of fee rules and the conditions under which they apply to Transactions.

<Note>
  Enable the Fees Engine in [Midaz module settings](/en/platform/console/plugin-settings) before you use this page.
</Note>

## What a Fee Package contains

***

A Fee Package lets you:

* **Define fee calculation rules** — flat fees, percentage-based fees, or combined calculations.
* **Set amount ranges** — apply fees only to transactions within a min/max range.
* **Link to transaction routes** — target specific transaction flows.
* **Waive fees for specific accounts** — exempt selected source accounts.
* **Prioritize fee application** — control the order in which Fees Engine applies multiple fees.

Fee Packages combine with [Accounting Routes](/en/midaz/console/managing-accounting-routes) and [Segments](/en/midaz/console/managing-segments) for granular control.

## Accessing the Fee Packages page

***

In the Midaz Module sidebar, expand **Fees Engine**. Select **Fee Packages**. The page lists every configured package.

<Note>
  If you have no Fee Packages, the list is empty and shows a prompt to create your first package.
</Note>

### Available actions

From the Fee Packages page, you can:

<Columns cols={2}>
  <Card title="Create a Fee Package" icon="plus" horizontal href="/en/midaz/fees/console/fe-creating-a-package">
    Define new fee calculation rules for transactions
  </Card>

  <Card title="Edit a Fee Package" icon="pen" horizontal href="/en/midaz/fees/console/fe-editing-a-package">
    Update fee configurations and rules
  </Card>

  <Card title="Delete a Fee Package" icon="trash" horizontal href="/en/midaz/fees/console/fe-deleting-a-package">
    Delete a fee package from your configuration
  </Card>
</Columns>

<Note>
  Select a package from the list to open its **details view**. There you can review the package's configuration — type, scope, and rules — before you edit it. To preview the fees a period generates across packages, use [Billing Runs](/en/midaz/fees/console/billing-runs).
</Note>

## Understanding Fee Package structure

***

When you create or edit a fee package in Midaz Module, you work with these fields:

### Basic information

* **Fee Group Label** (required) - A descriptive name for the fee package
* **Description** (optional) - Explanation of the package purpose and when it applies
* **Transaction Route** (optional) - Link to a specific transaction route
* **Segment** (optional) - Associate with a specific segment
* **Ledger** (required) - The ledger this package applies to

### Amount range

* **Minimum Amount** (required) - Lowest transaction amount for fee application
* **Maximum Amount** (required) - Highest transaction amount for fee application
* **Waived Accounts** (optional) - List of account aliases exempt from these fees

### Fee rules

Each fee package can contain multiple fee rules with:

* **Fee Label** - Name that identifies this fee
* **Application Rule** - How Fees Engine calculates the fee:
  * `flatFee` - Fixed amount regardless of transaction value
  * `percentual` - Percentage of the transaction amount
  * `maxBetweenTypes` - Higher value between flat and percentage calculations
* **Calculation Type** - `flat` or `percentage`
* **Calculation Value** - The fee amount or percentage
* **Reference Amount** - Base for percentage calculation:
  * `originalAmount` - Calculate on the original transaction value
  * `afterFeesAmount` - Calculate after Fees Engine applies other fees
* **Priority** - Order of fee application (lower numbers apply first)
* **Is Deductible From** - Whether Fees Engine deducts this fee from the transaction
* **Credit Account** - Account that receives the fee amount

## Common use cases

***

<AccordionGroup>
  <Accordion title="Simple flat fee per transaction">
    Apply a fixed fee to all transactions within an amount range:

    * **Application Rule**: `flatFee`
    * **Calculation**: `flat` with value `2.50`
    * **Example**: $2.50 fee on every transaction between $10 and \$1000
  </Accordion>

  <Accordion title="Percentage-based fee">
    Charge a percentage of the transaction amount:

    * **Application Rule**: `percentual`
    * **Calculation**: `percentage` with value `1.5`
    * **Example**: 1.5% fee on transfers, where $100 transfer = $1.50 fee
  </Accordion>

  <Accordion title="Tiered fee structure">
    Create multiple packages with different amount ranges:

    * Package 1: $0-$100 → 2% fee
    * Package 2: $100-$1000 → 1.5% fee
    * Package 3: \$1000+ → 1% fee
    * Lower fees for higher-value transactions
  </Accordion>

  <Accordion title="Combined flat + percentage (maximum)">
    Apply whichever is higher between flat and percentage:

    * **Application Rule**: `maxBetweenTypes`
    * **Calculations**: `flat: 1.00` and `percentage: 2.0`
    * **Example**: On $30 transaction: max($1.00, $0.60) = $1.00 fee
    * **Example**: On $100 transaction: max($1.00, $2.00) = $2.00 fee
  </Accordion>

  <Accordion title="Fee waiver for premium accounts">
    Exempt specific accounts from fees:

    * Create package with standard fee rules
    * Add premium account aliases to **Waived Accounts** list
    * These accounts transact without the configured fees
  </Accordion>
</AccordionGroup>

## Best practices

***

<Steps>
  <Step title="Plan your fee structure">
    Design your fee packages before implementation. Consider transaction types, amount ranges, and customer segments that require different fee treatments.
  </Step>

  <Step title="Use descriptive labels">
    Choose clear fee group labels and descriptions that explain when and why fees apply. This helps with auditing and customer communication.
  </Step>

  <Step title="Set appropriate amount ranges">
    Define minimum and maximum amounts carefully to avoid gaps or overlaps in your fee structure.
  </Step>

  <Step title="Test fee calculations">
    Use the [Fee Estimation](/en/midaz/fees/console/fe-fee-simulation) feature to preview fee calculations before you enable packages in production.
  </Step>

  <Step title="Manage priority carefully">
    When you use multiple fees in a package, set priorities so the fees apply in the correct order.
  </Step>

  <Step title="Document waived accounts">
    Record why you waive fees for certain accounts. This supports audit and compliance.
  </Step>
</Steps>

## Fee calculation flow

***

When Fees Engine processes a transaction, it:

1. Identifies applicable fee packages based on transaction route and segment
2. Filters packages by amount range (transaction must fall within min/max)
3. Checks whether the account is in the waived accounts list
4. Applies fee rules in priority order
5. Calculates each fee based on application rule and reference amount
6. Credits fee amounts to designated accounts

<Note>
  Enable a fee package so it applies to transactions. To pause a package, disable it. A disabled package stays in your configuration.
</Note>
