# Modify a loan application

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

Loan application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method.

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

## Request body (application/json)
- `allowFullTermForTranche` (boolean): Allow full term length for each tranche disbursement
- `amortizationType` (integer)
- `charges` (array of PutLoansLoanIdChargeData)
- `clientId` (integer)
- `collateral` (array of PutLoansLoanIdCollateral)
- `createStandingInstructionAtDisbursement` (boolean)
- `dateFormat` (string)
- `disbursedAmountPercentageForDownPayment` (number)
- `disbursementData` (array of PutLoansLoanIdDisbursementData)
- `enableAutoRepaymentForDownPayment` (boolean)
- `enableDownPayment` (boolean)
- `enableInstallmentLevelDelinquency` (boolean)
- `expectedDisbursementDate` (string)
- `fixedLength` (integer)
- `fixedPrincipalPercentagePerInstallment` (number)
- `fraud` (boolean)
- `graceOnArrearsAgeing` (integer)
- `interestCalculationPeriodType` (integer)
- `interestChargedFromDate` (string)
- `interestRateFrequencyType` (integer)
- `interestRatePerPeriod` (number)
- `interestRecognitionOnDisbursementDate` (boolean)
- `interestType` (integer)
- `isEqualAmortization` (boolean)
- `isTopup` (boolean)
- `linkAccountId` (integer)
- `loanIdToClose` (integer)
- `loanScheduleProcessingType` (string)
- `loanTermFrequency` (integer)
- `loanTermFrequencyType` (integer)
- `loanType` (string)
- `locale` (string)
- `maxOutstandingLoanBalance` (integer)
- `numberOfRepayments` (integer)
- `principal` (integer)
- `productId` (integer)
- `repaymentEvery` (integer)
- `repaymentFrequencyDayOfWeekType` (integer)
- `repaymentFrequencyNthDayType` (integer)
- `repaymentFrequencyType` (integer)
- `repaymentsStartingFromDate` (string)
- `submittedOnDate` (string)
- `transactionProcessingStrategyCode` (string)

## Responses
- `200`: OK

## Response fields
- `changes` (PutLoansLoanIdChanges)
- `clientId` (integer)
- `loanId` (integer)
- `officeId` (integer)
- `resourceExternalId` (string)
- `resourceId` (integer)

## Example request (cURL)
```bash
curl -X PUT \
  'http://localhost:8080/lokta-lms/api/v1/loans/{loanId}' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default' \
  -H 'Content-Type: application/json' \
  -d '{
  "allowFullTermForTranche": false,
  "amortizationType": 1,
  "charges": [
    {
      "amount": 1,
      "chargeCalculationType": 1,
      "chargeId": 1,
      "chargePaymentMode": 1
    }
  ],
  "clientId": 1,
  "collateral": [
    {
      "clientCollateralId": 1,
      "quantity": 1
    }
  ],
  "createStandingInstructionAtDisbursement": true,
  "dateFormat": "dd MMMM yyyy",
  "disbursedAmountPercentageForDownPayment": 0,
  "disbursementData": [
    {
      "dateFormat": "dd MMMM yyyy",
      "expectedDisbursementDate": "19 August 2026",
      "interestType": 1,
      "isEqualAmortization": true
    }
  ],
  "enableAutoRepaymentForDownPayment": false
}'
```

## Example response
```json
{
  "changes": {
    "fraud": false,
    "locale": "en",
    "principal": 5000
  },
  "clientId": 1,
  "loanId": 1,
  "officeId": 2
}
```

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