Reconciliation Engine
The Reconciliation Engine serves as the cross-verification layer of the LoanPilot platform. It algorithmically compares data points extracted from disparate sources—Bank Statements, GST Returns, and Financial Statements (P&L/Balance Sheets)—to identify discrepancies, validate reported turnover, and detect potential financial misreporting.
Overview
While individual document analysis provides a snapshot of a borrower's health, the Reconciliation Engine ensures consistency across the entire application. It specifically targets "trust gaps" by verifying that:
- Sales reported in GST filings align with credits observed in bank statements.
- Revenue stated in Profit & Loss (P&L) statements is reflected in actual cash flow.
- Debt obligations mentioned in financial statements match EMI patterns in bank accounts.
API Reference
The reconciliation process is managed via the /api/analyze/reconciliation endpoint.
Trigger Reconciliation
POST /api/analyze/reconciliation
Initiates the cross-referencing logic for a specific application. This should be called after the individual document analyses (Bank, GST, Financials) have been completed.
Request Body:
{
"applicationId": "uuid-of-the-loan-application"
}
Response:
- 200 OK: Returns the generated reconciliation report.
- 404 Not Found: If the application or necessary prerequisite analyses are missing.
Fetch Reconciliation Results
GET /api/analyze/reconciliation?applicationId={id}
Retrieves the most recent reconciliation analysis for a given application.
Query Parameters:
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| applicationId | string | Yes | The unique identifier of the loan application. |
Success Response:
{
"success": true,
"analysis": {
"id": "uuid",
"application_id": "uuid",
"gst_vs_bank_summary": {
"gst_turnover": 1200000,
"bank_credits": 1150000,
"variance_percentage": 4.16
},
"bank_vs_pl_summary": {
"reported_revenue": 1250000,
"actual_inflow": 1150000
},
"created_at": "2023-10-27T..."
}
}
Data Dependencies
The engine requires data from the following modules to perform a full audit:
- Bank Statement Analysis: Provides actual cash inflows, outflows, and EMI patterns.
- GST Returns Analysis: Provides statutory declarations of sales and tax payments.
- Financial Statement Analysis: Provides the borrower’s "book" view of revenue, expenses, and liabilities (P&L and Balance Sheet).
[!IMPORTANT] If one of the primary document types is missing, the engine will perform a partial reconciliation based on available data.
Key Reconciliation Checks
The engine performs several critical checks, which are returned in the analysis object:
1. Turnover Reconciliation (GST vs. Bank)
Compares the total outward supplies declared in GST returns against the total identifiable business credits in bank statements.
- Significance: Large variances (e.g., >15%) may indicate off-book sales or inflated GST filings.
2. Income Verification (Bank vs. P&L)
Cross-references the net income and revenue stated in the Profit & Loss statement against the actual net cash flow and credits in the bank account.
- Significance: Validates that the business is generating the liquidity it claims on paper.
3. Liability Verification
Matches "Long Term Debt" or "Current Liabilities" from the Balance Sheet against detected EMI transactions in the Bank Statement.
- Significance: Detects undisclosed loans or confirms the servicing of existing debt.
4. Operational Consistency
Checks if the "Cost of Goods Sold" or "Operating Expenses" in the P&L aligns with the category-wise debit patterns (e.g., payments to suppliers) in the bank statement.
Implementation Notes
The Reconciliation Engine is an internal service called via the API route. It does not require external AI providers for its core logic, as it operates on the structured JSON data already extracted and stored in the database from previous analysis steps.
To utilize the engine in a custom workflow, ensure the following sequence is respected:
- Upload and Analyze Bank Statement.
- Upload and Analyze GST Returns.
- Upload and Analyze Financial Statements (P&L).
- Call the Reconciliation POST endpoint.