# Approve Loan Application | Recover Loan Guarantee | Undo Loan Application Approval | Assign a Loan Officer | Unassign a Loan Officer | Reject Loan Application | Applicant Withdraws from Loan Application | Disburse Loan Disburse Loan To Savings Account | Undo Loan Disbursal

`POST /lokta-lms/api/v1/loans/{loanId}`

Approve Loan Application:
Mandatory Fields: approvedOnDate
Optional Fields: approvedLoanAmount and expectedDisbursementDate
Approves the loan application

Recover Loan Guarantee:
Recovers the loan guarantee

Undo Loan Application Approval:
Undoes the Loan Application Approval

Assign a Loan Officer:
Allows you to assign Loan Officer for existing Loan.

Unassign a Loan Officer:
Allows you to unassign the Loan Officer.

Reject Loan Application:
Mandatory Fields: rejectedOnDate
Allows you to reject the loan application

Applicant Withdraws from Loan Application:
Mandatory Fields: withdrawnOnDate
Allows the applicant to withdraw the loan application

Disburse Loan:
Mandatory Fields: actualDisbursementDate
Optional Fields: transactionAmount and fixedEmiAmount
Disburses the Loan

Disburse Loan To Savings Account:
Mandatory Fields: actualDisbursementDate
Optional Fields: transactionAmount and fixedEmiAmount
Disburses the loan to Saving Account

Undo Loan Disbursal:
Undoes the Loan Disbursal
Showing request and response for Assign a Loan Officer

## Parameters
- `loanId` (path, integer, required): loanId
- `command` (query, string): command

## Request body (application/json)
- `actualDisbursementDate` (string)
- `adjustRepaymentDate` (string)
- `approvedLoanAmount` (number)
- `approvedOnDate` (string)
- `assignmentDate` (string)
- `dateFormat` (string)
- `disbursementData` (array of PostLoansLoanIdDisbursementData): List of PostLoansLoanIdDisbursementData
- `expectedDisbursementDate` (string)
- `externalId` (string)
- `fixedEmiAmount` (number)
- `fromLoanOfficerId` (integer)
- `locale` (string)
- `note` (string)
- `paymentTypeId` (integer)
- `rejectedOnDate` (string)
- `toLoanOfficerId` (integer)
- `transactionAmount` (number)
- `unassignedDate` (string)
- `withdrawnOnDate` (string)

## Responses
- `200`: OK

## Response fields
- `changes` (PostLoansLoanIdChanges): PostLoansLoanIdChanges
- `clientId` (integer)
- `loanId` (integer)
- `officeId` (integer)
- `resourceExternalId` (string)
- `resourceId` (integer)
- `subResourceExternalId` (string)
- `subResourceId` (integer)

## Example request (cURL)
```bash
curl -X POST \
  'http://localhost:8080/lokta-lms/api/v1/loans/{loanId}' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default' \
  -H 'Content-Type: application/json' \
  -d '{
  "actualDisbursementDate": "28 June 2022",
  "adjustRepaymentDate": "28 July 2022",
  "approvedLoanAmount": 1000,
  "approvedOnDate": "28 June 2022",
  "assignmentDate": "02 September 2014",
  "dateFormat": "dd MMMM yyyy",
  "disbursementData": [
    {
      "expectedDisbursementDate": "19 August 2026",
      "principal": 22000
    }
  ],
  "expectedDisbursementDate": "28 June 2022",
  "externalId": "3e7791ce-aa10-11ec-b909-0242ac120002",
  "fixedEmiAmount": 500
}'
```

## Example response
```json
{
  "changes": {
    "approvedOnDate": "28 June 2022",
    "dateFormat": "dd MMMM yyyy",
    "locale": "en",
    "note": "Loan approval note"
  },
  "clientId": 6,
  "loanId": 3,
  "officeId": 2
}
```

Interactive: https://developer.lokta.ai/reference.html#operation/handleCommandsLoan
