Quickstart: a borrower to a first repayment
This walks one loan through its life. You authenticate, create a client, apply for a loan, approve and disburse it, then record a repayment.
Before you start
- A tenantIts identifier goes in the Tenant-Identifier header of every request. The examples use
default. - A userWith permission to create clients and loans, and to approve, disburse and post repayments. Open the reference
- An office idA client is created at an office. The examples use
officeId1. - A loan productConfigured on the tenant. A loan is created from a product. Open the reference
- A date formatEvery date is sent with the
dateFormatandlocalethat describe it. The examples usedd MMMM yyyyanden.
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. Check your credentials
This returns the roles and permissions the user holds. The call is refused when the credentials are wrong.
curl -X POST "$LOKTA_API/lokta-lms/api/v1/authentication" \
-u "$LOKTA_USER:$LOKTA_PASS" \
-H "Tenant-Identifier: default" \
-H "Content-Type: application/json" \
-d '{
"username": "your-username",
"password": "your-password"
}'
2. Create the client
Send firstname and lastname for a person, or fullname for a business. Send active as true with an activationDate.
Every date travels with the dateFormat and locale that describe it. The response carries the new clientId.
/v1/clientscurl -X POST "$LOKTA_API/lokta-lms/api/v1/clients" \
-u "$LOKTA_USER:$LOKTA_PASS" \
-H "Tenant-Identifier: default" \
-H "Content-Type: application/json" \
-d '{
"officeId": 1,
"firstname": "Asha",
"lastname": "Rao",
"active": true,
"activationDate": "01 September 2026",
"submittedOnDate": "01 September 2026",
"dateFormat": "dd MMMM yyyy",
"locale": "en"
}'
Keep the clientId from the response. The next steps call it $CLIENT_ID.
3. Find the loan product
A loan is created from a product. List the products on the tenant and note the id of the one you want.
curl -X GET "$LOKTA_API/lokta-lms/api/v1/loanproducts" \
-u "$LOKTA_USER:$LOKTA_PASS" \
-H "Tenant-Identifier: default"
The next steps call the product id $PRODUCT_ID.
4. Get the loan template
Ask for the template with the client, the product and the template type. It returns the default terms and the option lists for the fields the application needs, so you send values your tenant accepts.
curl -X GET "$LOKTA_API/lokta-lms/api/v1/loans/template?clientId=$CLIENT_ID&productId=$PRODUCT_ID&templateType=individual" \
-u "$LOKTA_USER:$LOKTA_PASS" \
-H "Tenant-Identifier: default"
5. Submit the application
These fields are mandatory. Take the option values from the template response.
clientId, productIdThe client and the product from the steps above.
principalThe amount applied for.
loanTermFrequency, loanTermFrequencyTypeThe length of the loan and the unit it is measured in.
numberOfRepayments, repaymentEvery, repaymentFrequencyTypeHow many repayments, and how often.
interestRatePerPeriod, interestType, interestCalculationPeriodType, amortizationTypeThe interest terms.
transactionProcessingStrategyCodeHow a repayment is split across the amounts due.
loanTypeThe type of loan account.
expectedDisbursementDate, submittedOnDateDates, sent with dateFormat and locale.
The numeric codes and the strategy code below are examples. Use the values the template returned for your product.
/v1/loanscurl -X POST "$LOKTA_API/lokta-lms/api/v1/loans" \
-u "$LOKTA_USER:$LOKTA_PASS" \
-H "Tenant-Identifier: default" \
-H "Content-Type: application/json" \
-d '{
"clientId": 1,
"productId": 1,
"principal": 100000,
"loanTermFrequency": 12,
"loanTermFrequencyType": 2,
"numberOfRepayments": 12,
"repaymentEvery": 1,
"repaymentFrequencyType": 2,
"interestRatePerPeriod": 2,
"interestType": 0,
"interestCalculationPeriodType": 1,
"amortizationType": 1,
"transactionProcessingStrategyCode": "principal-interest-penalties-fees-order-strategy",
"loanType": "individual",
"expectedDisbursementDate": "03 September 2026",
"submittedOnDate": "01 September 2026",
"dateFormat": "dd MMMM yyyy",
"locale": "en"
}'
The response carries the loanId. The next steps call it $LOAN_ID.
6. Approve the loan
State changes are commands on the loan. Approving needs the date it was approved on.
curl -X POST "$LOKTA_API/lokta-lms/api/v1/loans/$LOAN_ID?command=approve" \
-u "$LOKTA_USER:$LOKTA_PASS" \
-H "Tenant-Identifier: default" \
-H "Content-Type: application/json" \
-d '{
"approvedOnDate": "02 September 2026",
"dateFormat": "dd MMMM yyyy",
"locale": "en"
}'
7. Disburse the loan
Disbursing needs the date the money went out.
curl -X POST "$LOKTA_API/lokta-lms/api/v1/loans/$LOAN_ID?command=disburse" \
-u "$LOKTA_USER:$LOKTA_PASS" \
-H "Tenant-Identifier: default" \
-H "Content-Type: application/json" \
-d '{
"actualDisbursementDate": "03 September 2026",
"dateFormat": "dd MMMM yyyy",
"locale": "en"
}'
8. Record a repayment
Repayments are transactions on the loan. The body carries the date and the amount.
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"
}'
9. Read the loan back
Retrieve the loan to see its status and balances, and list its transactions to see the repayment you just posted.
curl -X GET "$LOKTA_API/lokta-lms/api/v1/loans/$LOAN_ID" \
-u "$LOKTA_USER:$LOKTA_PASS" \
-H "Tenant-Identifier: default"
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