Skip to main content
POST
/
v1
/
loans
/
external
/
{loan_external_id}
/
repayments
Record a repayment
curl --request POST \
  --url https://api-staging.bsa.ai/v1/loans/external/{loan_external_id}/repayments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "transactionAmount": 123
}
'

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.

Records a standard repayment against an active loan. The amount is allocated to interest then principal according to the loan’s processing rules. Two equivalent forms — prefer the externalId form for partner integrations.

Path parameters

loan_external_id
string
required
The loan’s externalId. On the /v1/loans/{loan_id}/repayments form, this is the numeric LMS id instead.

Request body

transactionAmount
number
required
Must be greater than 0.

Examples

# By loan externalId (recommended)
curl -sf -X POST "$BASE/v1/loans/external/halotel-tx-12345/repayments" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "transactionAmount": 11100 }'

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

Response

200 OK returns the repayment object showing how the amount was allocated.
{
  "id": "7821",
  "type": "Repayment",
  "date": "2026-05-25",
  "amount": 11100,
  "principal": 10000,
  "interest": 1100,
  "reversed": false
}

Errors

CodeWhen
not_foundNo loan with that id or externalId
failed_preconditionLoan is not in an active state
invalid_argumentMissing or non-positive transactionAmount