Recommended Workflows
In this page you will find the recommended workflows for setting up and managing Ledgers, configuring Accounts (with Portfolios and Segments), and handling Transactions in a double-entry manner.
Product managers and engineers play a crucial role in integrating Midaz into daily banking operations. Following structured workflows ensures consistency and precision in configuring and executing financial operations on the platform.
Let’s take a step back and consider a banking operation. If you're familiar with financial ledgers and banking activities, it should be intuitive to apply these workflows to any transaction involving the movement of funds.
Setting Up and Managing Ledgers
When onboarding to Midaz, follow these key steps to establish a solid foundation for your banking environment:
Step 1: Set Up the Organization
Your organization in Midaz represents your bank. If it hasn’t been created yet, set it up now. Ensure that all details—such as name and legal information—are accurate, as this entity serves as the primary context for all financial operations.
Step 2: Define Asset Types
Before creating a ledger, define all asset types your institution will use. This includes currencies (e.g., BRL, USD, EUR) and other assets like reward points or crypto. Establishing these in advance enables seamless integration into your ledger setup. Additional assets can be introduced as your product portfolio expands.
Step 3: Create the Ledger(s)
Now, set up a Ledger under your organization. Best practices suggest starting with a primary ledger for all customer accounts. Whether using the Midaz Console or API, ensure that each ledger is clearly named (e.g., “Main Banking Ledger”). Initially, the ledger won’t contain any accounts, but it serves as the foundation for transactions and account management.
Step 4: Configure the Chart of Accounts
From the outset, define your Chart of Accounts to categorize and route transactions effectively. Identify key account categories such as fees, interest, and payments, mapping them to placeholder accounts or account categories.
A best practice is to establish internal accounts for categories like “Fees Receivable” and “Interest Payable,” linking them to transaction types through the chart of accounts. This structure ensures accurate financial tracking and reporting.
Step 5: Ledger Administration
To maintain an organized financial system, establish clear processes for ledger management:
- Assign appropriate user roles with Midaz’s RBAC system to control access and permissions.
- Plan for additional ledgers if needed, documenting their purpose and assigned administrators.
- Regularly review ledger settings to maintain accuracy and ensure financial integrity. Midaz enforces double-entry accounting, but reconciling totals—especially when using external settlement accounts—helps maintain consistency.
Configuring Accounts, Portfolios, and Segments
This workflow guides you through onboarding customers, setting up accounts, and managing segmentation.
Step 1: Create a Customer Portfolio
When onboarding a new customer—individual or corporate—create a Portfolio under the appropriate ledger. Use the customer’s Entity ID (from your CRM system or the Midaz CRM plugin) in the Portfolio metadata for seamless mapping.
Step 2: Set Up Customer Accounts
For each financial product or asset the customer signs up for, create an account within their portfolio:
- A BRL-denominated checking account would be a separate entry.
- A USD or BTC account would be an additional account under the same portfolio.
- Assign meaningful account aliases for easy reference.
Step 3: Apply Segmentation
Determine whether the customer’s account belongs to a specific segment (e.g., Standard, Premium, Student). If using Midaz Segments, tag portfolios or accounts accordingly. This enables automated eligibility for benefits like fee exemptions or tiered interest rates.
Step 4: Establish Sub-Accounts
For businesses or specific use cases requiring sub-accounts, set them up under the main account. Use hierarchical naming conventions (e.g., “ABC Corp USD - Project X”) to maintain clarity.
Step 5: Initial Funding and Balance Setup
If an initial deposit is required, execute a transaction to credit the new account while debiting the corresponding funding source. This ensures compliance with double-entry principles—no manual balance adjustments are permitted.
Step 6: Verify and Review
Confirm that:
- The portfolio includes all necessary accounts.
- Accounts display correct asset types and initial balances.
- Segment assignments are properly reflected via API or the Midaz Console.
Step 7: Ongoing Account Management
Maintain account accuracy by implementing workflows for:
- Updating account metadata.
- Closing accounts while ensuring zero balances.
- Adjusting portfolio segmentation based on customer upgrades.
All these operations can be performed via the Console or API and should be integrated into your banking system’s frontend for operational efficiency.
Implementing Double-Entry Transaction Management
Midaz enforces double-entry principles, ensuring all financial operations are executed through transactions rather than direct balance manipulations.
Step 1: Define Transactions
For every financial event (deposit, transfer, withdrawal, fee charge), define a Transaction object specifying:
- Source and destination accounts.
- Debit and credit amounts.
- Relevant transaction metadata.
Step 2: Use Midaz’s Transaction DSL or API
Leverage Midaz’s Transaction DSL (Gold Language) or API to create transactions efficiently:
- The API allows for precise control over transaction payloads.
- The DSL simplifies transaction declaration with high-level syntax.
Step 3: Ensure Double-Entry Compliance
Midaz automatically validates transactions for balance integrity. If debits and credits don’t match, the transaction is rejected, preventing ledger corruption.
Step 4: Route Transactions via the Chart of Accounts
When posting transactions, include relevant Chart of Accounts references to ensure accurate categorization. For instance, tagging a fee operation with "FEE_INCOME"
streamlines financial reporting.
Step 5: Implement Idempotency and Tracking
To prevent duplicate transactions due to network failures, utilize Midaz’s idempotency keys. Send a unique transaction reference with each API request—if a retry is needed, Midaz will recognize and prevent unintended duplication.
Step 6: Monitor Transactions and Reconcile
Leverage Midaz’s monitoring tools to:
- Audit posted transactions.
- Identify failed or rolled-back operations.
- Reconcile daily transactions against expected flows.
Step 7: Handle Reversals and Corrections
Instead of deleting transactions, post corrective transactions that reverse prior operations. Maintain clear audit trails by linking reversals to their corresponding original transactions.
Step 8: Optimize Multi-Step Workflows
For complex operations like interest calculations or batch payments:
- Group operations into a single transaction where possible.
- Utilize Midaz’s support for multi-operation transactions to enhance efficiency and maintain atomicity.
By adhering to these best practices, you ensure financial operations remain transparent, auditable, and compliant. Midaz’s double-entry system enforces financial discipline, eliminating common pitfalls and ensuring a single source of truth for banking transactions.
Updated 2 days ago