Repayments, refunds and write-offs
After disbursal, everything that changes what a borrower owes is a transaction on the loan. You post one with a command, and you read them back the same way you read any list.
Before you start
- A disbursed loanTransactions are posted against a loan that has been approved and disbursed. Open the guide
- A userWith permission to post and adjust loan transactions. Open the reference
- The loan idThe commands below call it $LOAN_ID. It is the
loanIdreturned when the loan was created.
Set your environment
Every request authenticates with HTTP Basic and names its tenant in a header. Set these once and the commands below work as written.
export LOKTA_API="https://default.lokta.tech"
export LOKTA_USER="your-username"
export LOKTA_PASS="your-password"
1. Post a transaction
Send the command as a query parameter. The body carries the transactionDate and the transactionAmount, with dateFormat and locale.
curl -X POST "$LOKTA_API/lokta-lms/api/v1/loans/$LOAN_ID/transactions?command=repayment" \
-u "$LOKTA_USER:$LOKTA_PASS" \
-H "Tenant-Identifier: default" \
-H "Content-Type: application/json" \
-d '{
"transactionDate": "03 October 2026",
"transactionAmount": 1000,
"dateFormat": "dd MMMM yyyy",
"locale": "en"
}'
2. Choose the command
These are the most used commands. The endpoint page lists every command it accepts.
repaymentMake a repayment.
downPaymentRecord a down payment.
recoverypaymentMake a recovery payment.
merchantIssuedRefundMerchant issued refund.
payoutRefundPayout refund.
goodwillCreditGoodwill credit.
chargeRefundCharge refund.
refundByCashRefund an active loan by cash.
creditBalanceRefundRefund a credit balance.
waiveinterestWaive interest.
writeoffWrite off the loan.
undowriteoffUndo a write-off.
foreclosureForeclose an active loan.
closeClose the loan.
close-rescheduledClose a rescheduled loan.
3. List and inspect transactions
List a loan's transactions, then retrieve one to see its detail.
curl -X GET "$LOKTA_API/lokta-lms/api/v1/loans/$LOAN_ID/transactions" \
-u "$LOKTA_USER:$LOKTA_PASS" \
-H "Tenant-Identifier: default"
Note the id of the transaction you want to change. The next step calls it $TRANSACTION_ID.
4. Adjust a transaction
Post to the transaction itself with the corrected date and amount. There is no need to send a command parameter.
transactionDateMandatory. The corrected date, sent with dateFormat and locale.
transactionAmountMandatory. The corrected amount.
curl -X POST "$LOKTA_API/lokta-lms/api/v1/loans/$LOAN_ID/transactions/$TRANSACTION_ID" \
-u "$LOKTA_USER:$LOKTA_PASS" \
-H "Tenant-Identifier: default" \
-H "Content-Type: application/json" \
-d '{
"transactionDate": "03 October 2026",
"transactionAmount": 900,
"dateFormat": "dd MMMM yyyy",
"locale": "en"
}'
Where to go next
Every request authenticates with HTTP Basic and carries a Tenant-Identifier header. See the conventions. Read this guide as Markdown.
This is the API reference for Lokta, the agentic loan servicing platform. Go to lokta.ai