Fee Configuration
Configure fees charged to merchants for payment processing. The fee model defines how revenue is split between you, the platform, payment providers, and referral partners.
Fee Decomposition Model
Every transaction fee is broken down into four configurable components and one derived component:
merchantFee = providerFee + platformFee + tenantFee + partnerCommission| Component | Who sets it | Description |
|---|---|---|
merchantFee | You (operator) | Total fee charged to the merchant. This is the only fee the merchant sees. |
providerFee | You (operator) | Cost charged by the payment provider. Recorded as an off-ledger memo — not a ledger entry. |
platformFee | Platform | Miracle platform fee for software usage. Optional. |
partnerCommission | You (operator) | Commission paid to the partner who referred the merchant. Optional. |
tenantFee | Derived | Your margin. Calculated automatically as the residual. |
The formula for your margin:
tenantFee = merchantFee - providerFee - platformFee - partnerCommissionYou never set tenantFee directly. It is always the residual after all other components are subtracted. If tenantFee becomes negative, the system shows a warning — this means you are paying more to process a transaction than you charge the merchant.
Fee Visibility by Role
Not all users see the same fee information. Visibility is determined by role:
| Data | Merchant | Operator (you) | Owner (platform) | Partner |
|---|---|---|---|---|
| Merchant fee (total per transaction) | Yes | Yes | Yes | No |
| Fee decomposition (provider, platform, tenant, partner) | No | Yes | Yes | No |
| Negative tenantFee warning | No | Yes | Yes | No |
| Fee history (timeline) | Own current rate only | Full history | Full history, cross-tenant | No |
| Partner commission details | No | Yes | Yes | Own commission only |
| Recurrent fee charges | Own charges only | Full view | Full view, cross-tenant | No |
Merchants see a single number — their total fee. They never see how it is decomposed internally. Partners see only their own commission on linked merchants.
Fee Schedules
A fee schedule is a rate card — a named collection of fee rules that define pricing for specific transaction types and currencies.
Fee Schedule Lifecycle
Fee schedules follow a strict lifecycle to ensure pricing integrity:
draft → active → archived| Status | Can edit rules? | Can assign to entities? | Description |
|---|---|---|---|
| Draft | Yes | No | Schedule is being prepared. Rules can be added, changed, or removed freely. |
| Active | No (frozen) | Yes | Schedule is locked. Rules are immutable. This is the only status that can be assigned to merchants, channels, or terminals. |
| Archived | No | No (new assignments blocked) | Schedule is retired. Existing assignments continue working until their effectiveTo date, but no new assignments can be created. |
To change pricing on an active schedule: create a new schedule (draft), configure the updated rules, activate it, then reassign your entities to the new schedule. The old schedule can be archived once all assignments have transitioned.
Creating a Fee Schedule
Portal: Navigate to Fees > Fee Schedules > Create.
- Name: Give the schedule a descriptive name (e.g., "Standard Card Rates EUR").
- Fee rules: Add one or more rules. Each rule defines pricing for a specific combination:
| Field | Description |
|---|---|
| Transaction type | Which transaction type this rule covers (e.g., payment, refund, chargeback) |
| Transaction outcome | Whether this rule applies to successful, declined, or any transactions |
| Currency | Which currency this rule applies to |
| Fee type | fixed, percentage, or fixed_plus_percentage (fixed + percentage) |
| Percentage rate | Rate in basis points (0--10000). For example, 290 = 2.9%, 250 = 2.5% |
| Flat fee | Fixed amount in minor units (e.g., 30 for EUR 0.30) |
| Minimum fee | Floor — merchant is charged at least this amount per transaction |
| Maximum fee | Ceiling — merchant is never charged more than this amount per transaction |
All monetary values are in integer minor units (cents, pence, etc.). For example, EUR 0.30 is represented as 30.
When both minimum and maximum fees are specified, the system enforces that minimum is less than or equal to maximum. Rounding for percentage calculations is handled automatically by the billing engine using banker's rounding (half-up).
Fee Rule Matching
When a transaction is processed, the billing engine selects the appropriate fee rule from each applicable schedule by matching on three keys:
- Transaction type —
payment,refund,chargeback, etc. - Transaction outcome —
successful,declined, orany - Currency — must match the transaction currency exactly
Within a single fee schedule, no two rules may share the same (transactionType, transactionOutcome, currency) combination. The system rejects duplicates at creation time.
Payment method (card, bank transfer, etc.) is NOT part of rule matching. Payment method is handled at the assignment level — you assign different fee schedules to a merchant for different payment methods. Within a schedule, rules match on transaction type, outcome, and currency only.
Fee Assignment Cascade
Fee schedules are assigned at multiple levels. The assignment level determines which fee component is being configured, and cascade resolution determines which assignment wins when multiple levels are configured.
Assignment Levels
Level 1: Terminal → Provider cost schedule (what the acquirer charges you)
Level 2: Channel (per currency + method) → Merchant fee schedule (overrides merchant-level)
Merchant (per currency + method) → Merchant fee schedule (what you charge the merchant)
Level 3: Tenant → Default merchant fee (fallback for merchants without direct assignment)
Level 4: Platform → Platform fee schedule (Miracle software fee)
Level 5: Partner (via PartnerAssignment) → Partner commission schedule (referral partner share)How Assignment Resolution Works
When calculating fees for a transaction, the system resolves each component independently:
1. Provider cost — Always from the terminal's assigned schedule (Level 1). Required.
2. Merchant fee — Resolved using a nearest-wins cascade. The system checks in this order and uses the first match found:
| Priority | Level | Lookup key |
|---|---|---|
| 1st (highest) | Channel | (channelId, currency, paymentMethod) |
| 2nd | Merchant | (merchantId, currency, paymentMethod) |
| 3rd | Tenant | (tenantId) — default pricing for all merchants |
| Not found | — | Billing gap — alert, transaction cannot be processed |
Channel-level overrides merchant-level. If a channel has its own fee schedule for (EUR, card), that takes priority over any merchant-level assignment for the same combination. Tenant-level is a fallback — it provides default merchantFee pricing when no direct merchant or channel assignment exists.
3. Platform fee — From the platform-level schedule (Level 4). Optional — if not configured, platformFee = 0.
4. Partner commission — From the partner assignment (Level 5). Optional — if no partner is linked, partnerCommission = 0.
Assigning a Fee Schedule
Portal: Select the target entity (merchant, terminal, etc.), then go to the Fees tab and select Assign Schedule.
For merchant-level and channel-level assignments, you specify both the currency and payment method. This allows different rates for different combinations — for example, 2.9% for card payments in EUR but 1.5% for bank transfers in EUR.
Only active fee schedules can be assigned. Draft schedules must be activated first. Archived schedules cannot be assigned to new entities.
Common Pricing Models
Here are practical examples of how to configure typical fee structures:
Fixed fee
Charge a fixed amount per transaction regardless of size.
| Setting | Value |
|---|---|
| Fee type | fixed |
| Flat fee | 25 (EUR 0.25) |
| Percentage rate | 0 |
Percentage fee
Charge a percentage of the transaction amount.
| Setting | Value |
|---|---|
| Fee type | percentage |
| Percentage rate | 290 (2.9%) |
| Flat fee | 0 |
Fixed plus percentage fee
Charge both a percentage and a fixed fee per transaction.
| Setting | Value |
|---|---|
| Fee type | fixed_plus_percentage |
| Percentage rate | 290 (2.9%) |
| Flat fee | 30 (EUR 0.30) |
For a EUR 100.00 transaction (10000 minor units), the merchant fee would be: 290 bps of 10000 + 30 = 290 + 30 = 320 minor units (EUR 3.20).
Fee with floor and ceiling
Charge a percentage with both minimum and maximum bounds.
| Setting | Value |
|---|---|
| Fee type | percentage |
| Percentage rate | 200 (2.0%) |
| Minimum fee | 50 (EUR 0.50) |
| Maximum fee | 5000 (EUR 50.00) |
For a EUR 10.00 transaction, the raw fee would be 20 cents — but the minimum floor of EUR 0.50 applies. For a EUR 5,000.00 transaction, the raw fee would be EUR 100.00 — but the maximum ceiling of EUR 50.00 caps it.
Recurrent Fees
In addition to per-transaction fees, the system supports periodic (recurrent) fees that are not tied to individual transactions. These cover recurring charges like access fees, monthly minimums, or subscription costs.
Two Directions
Recurrent fees operate in two directions:
| Direction | From | To | Examples |
|---|---|---|---|
| Platform to Tenant | Platform (Miracle) | You (the PSP) | SaaS subscription, infrastructure fee |
| Tenant to Merchant | You (the PSP) | Your merchants | Monthly access fee, service charge, monthly minimum |
How Recurrent Fees Work
Recurrent fees use a three-part model:
- Template — Defines the fee: name, amount, interval, and direction. Created by the entity that charges (platform creates templates for tenants, you create templates for your merchants).
- Assignment — Links a template to a specific target entity (tenant or merchant) with an effective date. Assignments can be active, suspended, or canceled.
- Charge — An immutable execution record created each billing period. Linked to a ledger entry for audit trail.
Intervals
| Interval | When charged |
|---|---|
weekly | Once per calendar week |
monthly | Once per calendar month |
yearly | Once per calendar year |
per_settlement | Once per settlement cycle (tied to settlement lifecycle, not calendar) |
The per_settlement interval is useful for charges like statement fees or settlement processing fees.
Managing Recurrent Fee Templates
Portal: Navigate to Fees > Recurrent Fee Templates.
- Create a template with a name, amount, interval, and direction.
- Once a template has active assignments, its amount and interval become immutable. To change terms, create a new template and reassign.
- Deactivate a template to prevent new assignments (existing assignments continue until canceled).
Managing Recurrent Fee Assignments
Portal: Select a merchant, go to the Fees tab, then Recurrent Fees.
- Assign a template with an effective start date.
- Suspend an assignment to temporarily pause charging.
- Cancel an assignment to stop it permanently.
Fee History
Fee schedules maintain a full history. When you update a fee assignment:
- A new record is created with an
effectiveFromdate. - The previous record automatically receives an
effectiveTodate. - Historical records are never deleted or modified.
This means the system can explain which fees were in effect for any transaction at any point in time — useful for auditing and dispute resolution.
Fee history is append-only. You cannot edit or delete past fee records. To change a fee, create a new assignment — the old one is automatically closed.
Best Practices
Set up provider costs first. Before configuring merchant fees, assign provider cost schedules to your terminals so the system can calculate your margin accurately.
Use tenant-level defaults. Set a tenant-level default fee schedule (Level 3) as a fallback. Then override at the merchant or channel level only when specific entities need custom pricing.
Activate before assigning. Fee schedules must be in active status before they can be assigned. Prepare your rules in draft, review them, then activate.
- Review
tenantFeeafter configuration to verify your margin is positive across all transaction types and currencies. - When onboarding a new provider, create a provider cost schedule that matches the acquirer's actual rate card.
- Use
fixed_plus_percentagepricing for card payments to cover both the interchange percentage and the per-transaction network fee. - Use
maxAmount(ceiling) to cap fees on high-value transactions where a flat cap is more competitive. - For recurrent fees, start with monthly interval — it is the most common billing cycle for merchant access fees.