LMS → Accounting
Push loan lifecycle events — disbursements, revenue reports, repayments, and early settlements — into the Accounting system via JSON POST requests.
Authentication
Every POST request requires an API key header. Missing or invalid keys return 401 Unauthorized immediately — the body is not processed.
| Header | Value |
|---|---|
| X-LMS-API-Key | API key from Accounting admin |
| Content-Type | application/json |
Event Ordering
Critical: The Accounting system enforces strict ordering per loan. Violating order causes processing failures.
Disbursement
Once at loan creation
Revenue Report
Monthly interest accrual
Repayment
Each installment
Early Settlement
If paid off early
/lms-integration/disbursement
DISBURSEMENT
Loan Disbursement
Send when a new loan is disbursed. Creates an invoice with loan principal receivable, bank disbursement, and admin fee.
| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
| customerId | String | Required | Must not be blank | LMS customer/borrower ID. Creates customer LMS-{customerId} in accounting. |
| customerName | String | Required | Must not be blank | Full name used when auto-creating the customer contact. |
| loanId | String | Required | Must not be blank | Unique loan identifier linking all subsequent events. |
| loanAmount | Number | Required | Must be > 0 | Total loan principal. bankDisbursement = loanAmount − adminFee − VAT. |
| adminFee | Number | Required | Not null (use 0) | Administration fee deducted from loan. VAT calculated at configured rate. |
| vatOnAdminFee | Number | Optional | — | Informational only. System recalculates VAT from admin fee. |
| disbursementDate | String | Required | yyyy-MM-dd | Date the loan was disbursed. |
/lms-integration/revenue-report
REVENUE_REPORT
Revenue Report
Send monthly to record interest income. Creates an interest invoice allocated against during repayments.
| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
| customerId | String | Required | Must not be blank | Same customer ID used in disbursement. |
| customerName | String | Required | Must not be blank | Customer full name. |
| loanId | String | Required | Must not be blank | Loan this interest belongs to. |
| revenueMonth | String | Required | yyyy-MM | Accrual month. Invoice date set to last day of month. |
| revenueAmount | Number | Required | Must be > 0 | Interest income amount for the month. |
/lms-integration/repayment
REPAYMENT
Loan Repayment
Send for each installment payment. Principal applies to disbursement invoice; interest applies FIFO against open interest invoices.
| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
| customerId | String | Required | Must not be blank | Same customer ID from disbursement. |
| customerName | String | Required | Must not be blank | Customer full name. |
| loanId | String | Required | Disbursement must exist | Loan this payment applies to. |
| repaymentPrincipal | Number | Required | Must be ≥ 0 | Principal portion. Use 0 for interest-only payments. |
| repaymentInterest | Number | Required | Must be ≥ 0 | Interest portion. Applied FIFO against interest invoices. |
| repaymentDate | String | Required | yyyy-MM-dd | Date repayment was received. |
| feeAmount | Number | Optional | — | Additional fee (e.g. late fee). Use 0 if none. |
| feeName | String | Optional | — | Fee description. Empty string if none. |
/lms-integration/early-settlement
EARLY_SETTLEMENT
Early Settlement
Send when a borrower pays off the remaining loan balance early. Closes out principal and remaining interest.
| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
| customerId | String | Required | Must not be blank | Same customer ID. |
| customerName | String | Required | Must not be blank | Customer full name. |
| loanId | String | Required | Disbursement must exist | Loan being settled. |
| repaymentEarlySettlementPrincipal | Number | Required | Must be ≥ 0 | Remaining principal balance being paid off. |
| repaymentEarlySettlementInterest | Number | Required | Must be ≥ 0 | Remaining interest being paid off. |
| repaymentEarlySettlementDate | String | Required | yyyy-MM-dd | Date of early settlement. |
| feeAmount | Number | Optional | — | Early settlement fee. Use 0 if none. |
| feeName | String | Optional | — | Fee description. |
Responses & Errors
HTTP Status Codes
200
Request accepted — check body for staging/push status
401
Missing or invalid X-LMS-API-Key
400
Malformed JSON body
500
Unexpected server failure
Application Failures
Well-formed requests that fail validation return 200 with: