REST API v1 · JSON · POST

LMS Accounting

Push loan lifecycle events — disbursements, revenue reports, repayments, and early settlements — into the Accounting system via JSON POST requests.

4 Endpoints
POST Method
{ } JSON
View Endpoints

🔐 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-KeyAPI key from Accounting admin
Content-Typeapplication/json

Event Ordering

Critical: The Accounting system enforces strict ordering per loan. Violating order causes processing failures.

1

Disbursement

Once at loan creation

2

Revenue Report

Monthly interest accrual

3

Repayment

Each installment

4

Early Settlement

If paid off early

POST /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.
POST /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.
POST /lms-integration/repayment REPAYMENT

Loan Repayment

Send for each installment payment. Principal applies to disbursement invoice; interest applies FIFO against open interest invoices.

Disbursement must be posted first. At least one of repaymentPrincipal or repaymentInterest must be > 0.
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.
POST /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.

Same prerequisites as repayment. At least one of repaymentEarlySettlementPrincipal or repaymentEarlySettlementInterest must be > 0.
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
OK

Request accepted — check body for staging/push status

401
Unauthorized

Missing or invalid X-LMS-API-Key

400
Bad Request

Malformed JSON body

500
Server Error

Unexpected server failure

Application Failures

Well-formed requests that fail validation return 200 with: