Fees
Represent financial charges consistently within your accounting workflows.
Financial applications often need to calculate, apply, and record fees associated with accounts, payments, or other services.
Infrarails supports ledger-based accounting workflows that can represent financial charges through structured transactions and entries.
Understanding fees
A fee is a charge associated with a financial service or business operation.
Depending on the application, fees may be calculated using fixed amounts, percentages, or other configured business rules.
Examples include:
- Account maintenance charges.
- Transaction fees.
- Payment processing fees.
- Service charges.
- Currency conversion fees.
The available fee calculation and configuration capabilities depend on the deployed product implementation.
Fee calculation models
Fixed fees
A fixed fee applies a predetermined amount.
For example, a monthly service fee of €16.99.
Fee amount: €16.99
Currency exponent: 2
Stored amount: 1699 minor units
Percentage-based fees
A percentage-based fee is calculated from an operation amount.
For example, a 1% charge on a €500.00 operation:
Operation amount: €500.00
Fee percentage: 1%
Calculated fee: €5.00
The calculation method, rounding rules, and minimum or maximum fee limits must be defined by the applicable fee configuration.
Combined fees
Some business models use both a fixed charge and a percentage-based charge.
For example:
Operation amount: €500.00
Fixed fee: €1.00
Percentage fee: 1%
Percentage component: €5.00
Total fee: €6.00
This is an illustrative fee calculation, not a predefined Infrarails pricing rule.
Fee accounting
Fees can be represented through ledger transactions.
For example, charging a customer account €10.00:
| Account | Direction | Amount |
|---|---|---|
| Customer Account | Debit | €10.00 |
| Fee Revenue Account | Credit | €10.00 |
The total debit and credit amounts remain equal.
Fees and payment operations
A payment workflow may calculate fees before executing the underlying operation.
For example:
| Component | Amount |
|---|---|
| Payment amount | €100.00 |
| Payment fee | €2.50 |
| Total customer debit | €102.50 |
The accounting treatment depends on the payment model.
A possible ledger representation is:
| Account | Direction | Amount |
|---|---|---|
| Customer Account | Debit | €102.50 |
| Payment Clearing Account | Credit | €100.00 |
| Fee Revenue Account | Credit | €2.50 |
This example illustrates a balanced accounting treatment and does not prescribe the implementation of every payment workflow.
Fee structures
Applications may use fee structures to organize business-specific pricing rules.
A fee structure can conceptually associate charges with particular services, transaction categories, or customer groups.
The actual fee structure schema and available calculation rules are defined by the relevant API contract.
Fee precision
Fees should be calculated and recorded using the currency's documented precision.
For EUR with exponent 2:
| Fee | Minor units |
|---|---|
| €0.50 | 50 |
| €1.00 | 100 |
| €2.50 | 250 |
| €16.99 | 1699 |
| €100.00 | 10000 |
Avoid floating-point arithmetic when calculating financial charges.
Rounding
Percentage-based fees may produce fractional minor units.
For example, a percentage calculation might produce a value that cannot be represented exactly in the currency's smallest unit.
Applications should follow the documented rounding rules rather than applying inconsistent rounding across services.
Recurring fees
Some applications require recurring charges, such as monthly account maintenance fees.
A recurring fee workflow may involve:
- Identifying eligible accounts.
- Determining the applicable fee structure.
- Calculating the charge.
- Creating the associated ledger transaction.
- Recording the processing outcome.
- Producing an audit or operational report.
Recurring charging schedules, eligibility rules, and execution mechanisms are deployment-specific.
Fee reversals and corrections
If a fee has already been recorded through a completed transaction, corrections should use an appropriate accounting operation.
Applications should not assume that a completed transaction can be deleted or modified to remove its financial effects.
Best practices
- Store fee amounts in integer minor units.
- Apply consistent currency rounding rules.
- Validate fees before executing financial operations.
- Keep fee transactions traceable to their originating operation.
- Separate fee calculation from accounting posting.
- Use idempotency to prevent duplicate charges.
- Reconcile fee revenue accounts.
- Retain fee calculation details for audit and troubleshooting.
Next steps
Continue with Provider Integrations to understand how external financial infrastructure can be connected with InfraRails accounting.
Updated about 1 hour ago