Transforming Finance at Apollo
Building an Automated Reconciliation System that Revolutionized Accounting
Technology plays a big role in the fast-paced world of finance, where being quick and precise is super important. One such example is Reconciliation.
What is Reconciliation?
A Reconciliation system is a process that assists organizations in ensuring that their internal financial records are consistent with external records, such as bank statements or records from counterparties. The primary purpose of such a system is to identify discrepancies, errors, or anomalies that might arise due to various reasons like transactional errors or fraudulent activities
At Apollo Finvest, we made a particular system that does all the work of reconciling things, auto-magically
This system has made an enormous difference – it reduced the work of our finance team by a whopping 90%!
In this blog post, we'll explain all the details about this cool project. We'll talk about the old process, its issues, how the new system works, how we put it into action, and how it made a big difference in our reconciliation system.
Old Process:
Our old operational procedure involved the following steps:
Every month
We acquired the repayment file from the Fintech Partner
The second step was to obtain payment received reports from the payment gateways
Subsequently, we generated reconciliation reports by cross-referencing the payments received with the payments provided to us by fintech partners
Problems with the old process:
Our finance team had a tough time dealing with a lot of work with demanding timelines. Countless transactions needed to be recorded, reconciled, and verified each day, leading to a high risk of errors and inefficiencies.
Especially due to the month-end nature of the process, the following issues existed as well:
The Fintech Partner would be informed of the loan closure status at the end of the month for borrowers who had fully repaid their loan amounts
For loan products that had revolving credit limits (similar to how Credit Cards work) when payments were uploaded at month-end, the remaining balance sometimes did not reflect real-time changes, potentially impacting the borrower limits
There was a chance of errors in the manual reconciliation process
Based on all these potential issues, we recognized the need for a comprehensive solution that would not only automate these tasks but also integrate seamlessly with a range of Payment Gateways to receive transactions and process them automatically.
Our Solution: An Automated Reconciliation System
Let’s dive right into it!
Architecture and Design:
The automated Reconciliation system is designed as a robust and scalable microservices architecture. We used AWS Serverless Architecture to deploy the complete workflow.
A simple high-level architecture diagram to explain how it is built and used is shown below:
Payment Gateway Integration:
During our project, a key task involved integrating multiple Payment Gateways to receive transactions and update the amortization table accordingly. To achieve this, we developed specialized adapters for each gateway, enabling efficient communication between our system and various payment gateways, including Razorpay, Cashfree, and others.
Implementation:
We have integrated through the payment gateway webhook to listen to different events related to payment happening across the platform.
When we have a successful payment made on the platform after processing the event, we store it and update the amortization table.
In the case of a refund event through the payment gateway, we update the payment details and deallocate it from the loan ID.
This strategic approach provided a high degree of flexibility for our fintech partners, granting them the freedom to select their preferred payment gateway and also allowing them to get a real-time loan status
Automation Algorithms:
Automation served as the core foundation of our system. We developed complex logic designed to automate a range of tasks:
Repayment calculations
Real-time allocation to the amortization table
Handling of different scenarios depending on the repayment type
These scenarios include part-prepayment, early loan closure, and seamless interest benefit passing to customers.
The above process resulted in reduced manual errors and ensured swift, accurate repayment processing.
The Implementation Journey
Building the Automatic Reconciliation System was a multi-faceted project that required meticulous planning and execution. Here are some highlights of our implementation journey:
Agile Development: We adopted an agile development methodology, allowing us to respond swiftly to changing requirements and prioritize features based on their impact on reducing the finance team's workload
Development Process: The complexity of the repayment process lies in its dual nature, as it can either be executed manually or through automation, depending on the specific operational model of the Fintech Partner. To cater to both scenarios effectively, our development team embarked on creating an adaptable system that could seamlessly handle repayments from either approach.
We chose the AWS Serverless architecture to host our complete application, benefiting from its excellent scalability that aligned seamlessly with our requirements. Our approach involved the utilization of AWS Batch, Lambda functions, and SQS, carefully optimizing their usage to align with our distinct needs.
We used webhooks to ensure the integration of payment gateways was smooth and responsive. This real-time event-driven architecture not only allowed us to receive and process payments promptly but also granted us the agility to adapt to ever-evolving business requirements seamlessly.
The process to make the magic happen:
Payment Collection: We receive payments from various payment gateway portals. These payments are logged and stored in our database for record-keeping.
Partner Interaction: Partners interact with our system using our Repayment API. When they do so, we have a few important checks in place:
Data Validation: We carefully validate the data sent by the partner to ensure it's accurate and complete.
Payment Confirmation: We cross-verify whether the payment associated with this interaction has indeed been received in our payment gateway system. To do this, we integrate with multiple payment gateway APIs.
Communication with Fintech Partners: Once all the necessary checks are completed, we promptly update the Fintech Partner with the outcome of their repayment request. We achieve this by using a webhook integration, which allows us to send real-time responses to our partners.
Loan Table Update: Assuming all validation checks pass and the repayment is accepted, we update our loan table with the data. This ensures that the payment information is accurately reflected in our records.
Refunds Handling: If a refund is initiated directly from the payment gateway portal, it directly impacts our loan table. This means that refunds are seamlessly integrated into our system, keeping it up to date.
The primary trigger for initiating a refund is when a dispute arises from the borrower's side, and the objective is to resolve the matter in favor of the borrower. Alternatively, a refund may also be initiated when the borrower makes an extra payment during the loan closure process and subsequently requests the return of the surplus amount.
End-of-Day Settlement: At the close of each day, we perform a crucial task - settling all the transactions. We achieve this by invoking the Settlement API provided by the respective payment gateway. This process is essential for ensuring that all financial transactions are properly balanced and aids in the later reconciliation process.
In essence, our system was meticulously engineered to harmonize the diverse needs of the fintech partner, encompassing both manual and automated repayment processes.
Testing and Validation: Rigorous testing was conducted at every stage of development. We performed unit testing, integration testing, and user acceptance testing to identify and rectify any issues promptly.
The Impact: A 90% Reduction in Workload
The implementation of our Automated Repayment System brought about a transformational change in the way repayments were handled at Apollo. The results were nothing short of remarkable:
Efficiency Gains: Repayments that once consumed hours of manual effort were processed in mere minutes, leading to a 90% reduction in the finance team's workload
Accuracy: Automation virtually eliminated the possibility of human errors in repayment calculations and transaction processing
Fintech Partner Satisfaction: Partners valued the freedom to select their preferred Payment Gateway and the ability to update their lending books in real-time, which significantly enhanced their overall experience.
If this sounds interesting and you would like to participate in similar adventures, we’re hiring, please check out our open engineering roles.