Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lms.bsa.ai/llms.txt

Use this file to discover all available pages before exploring further.

A repayment is a transaction posted against an active loan. The API exposes two operations today: posting a new repayment, and reading one back by id. All repayment endpoints are nested under a loan. The loan can be addressed two equivalent ways. Prefer the externalId form — it lets you drive repayment flows off the reference you already store, with no client-side mapping to a numeric LMS id.

Addressing the loan

FormPath prefixWhen to use
By loan externalId (recommended)/v1/loans/external/{loan_external_id}/repayments/...Use the externalId you supplied on loan create.
By LMS id/v1/loans/{loan_id}/repayments/...Use the numeric id from the create response.
Both forms hit the same handlers and return identical responses. The externalId form returns 404 not_found if no loan matches.
# By loan externalId (recommended)
curl -X POST "$BASE/v1/loans/external/halotel-tx-12345/repayments" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"transactionAmount": 450}'

# Same effect, by LMS id
curl -X POST "$BASE/v1/loans/501/repayments" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"transactionAmount": 450}'

The repayment object

id
string
Unique transaction identifier. Use it on get.
type
string
Transaction type label. For partner-posted transactions this is always Repayment.
date
string
ISO-8601 YYYY-MM-DD. Date the transaction was effective.
amount
number
Total transaction amount.
principal
number
Portion applied to principal. Omitted if zero.
interest
number
Portion applied to interest. Omitted if zero.
overpaymentPortion
number
Overpayment amount, present only when the transaction exceeded the outstanding balance. Surfacing it on the response is a strong signal that something needs reconciling.
reversed
boolean
Whether this transaction has been reversed (always false on a fresh repayment — reversals are an operational LMS-side action).

Endpoints

MethodPathPurpose
POST/v1/loans/external/{loan_external_id}/repaymentsRepay by loan externalId (recommended)
POST/v1/loans/{loan_id}/repaymentsRepay by LMS id
GET/v1/loans/external/{loan_external_id}/repayments/{transaction_id}Get a transaction by loan externalId (recommended)
GET/v1/loans/{loan_id}/repayments/{transaction_id}Get a transaction by LMS id

Request body

POST /v1/loans/.../repayments takes a single-field body:
transactionAmount
number
required
Must be greater than 0.
The transaction date and payment method are filled in by the service.