Skip to main content

Update Loan Account

Overview

Updates modifiable information on an existing loan account.

Endpoint

POST /api/bpm/cmd

Request Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token for authentication
Content-TypestringYesMust be application/json
X-Tenant-IdstringYesTenant identifier

Request Body

{
"cmd": "UpdateLoanCommand",
"data": {
"accountName": "Updated Business Loan - ABC Company",
"salesChannel": "BRANCH",
"associationInformation": {
"accountOfficerEncodedKey": "8a8e8e8e7f0000017f0000000001",
"branchEncodedKey": "8a8e8e8e7f0000017f0000000002",
"loanEncodedKey": "8a8e8e8e7f0000017f0000000099"
},
"accountInformation": {
"loanAmount": 550000.00,
"interestRate": 14.5,
"loanTenor": 30,
"notes": "Updated loan terms after review",
"firstRepaymentDate": "2024-03-15T00:00:00Z",
"moratoriumType": 1,
"moratoriumPeriod": 2
},
"disbursementInformation": {
"disbursementAmount": 550000.00,
"disbursementDate": "2024-02-15T00:00:00Z",
"disbursementMethod": "BankTransfer",
"disbursmentChannelEncodedKey": "8a8e8e8e7f0000017f0000000003"
},
"comments": ["Terms updated after credit review", "Approved by manager"]
}
}

Parameters

ParameterTypeRequiredDescription
cmdstringYesMust be "UpdateLoanCommand"
dataobjectYesUpdate loan data object
↳ accountNamestringYesUpdated account name
↳ salesChannelstringNoSales channel code
↳ associationInformationobjectYesLoan associations
  â†³ accountOfficerEncodedKeystringYesAccount officer encoded key
  â†³ branchEncodedKeystringYesBranch encoded key
  â†³ loanEncodedKeystringYesLoan account encoded key to update
↳ accountInformationobjectYesUpdated account details
  â†³ loanAmountdecimalYesUpdated loan amount
  â†³ interestRatedecimalYesUpdated interest rate
  â†³ loanTenorintegerYesUpdated loan term in months
  â†³ notesstringNoUpdated notes
  â†³ firstRepaymentDatestringNoUpdated first repayment date (ISO 8601)
  â†³ moratoriumTypeintegerYesMoratorium type (0=None, 1=InterestOnly, 2=Full)
  â†³ moratoriumPeriodintegerYesMoratorium period in months
↳ disbursementInformationobjectYesUpdated disbursement information
  â†³ disbursementAmountdecimalYesUpdated disbursement amount
  â†³ disbursementDatestringYesUpdated disbursement date (ISO 8601)
  â†³ disbursementMethodstringYesDisbursement method
  â†³ disbursmentChannelEncodedKeystringNoDisbursement channel encoded key
↳ commentsarray[string]NoUpdate comments

Response

Success Response (200 OK)

{
"success": true,
"message": "Loan updated successfully",
"data": {
"loanId": "LA-2024-00001",
"loanAccountNumber": "3001234567890",
"loanOfficerId": "OFFICER-456",
"repaymentAccountId": "ACC-99999",
"lastModifiedAt": "2024-01-20T15:30:00Z",
"lastModifiedBy": "admin@bank.com"
}
}

Status Codes

CodeDescription
200Loan updated successfully
400Invalid request data
401Unauthorized
404Loan not found
500Internal server error

Business Rules

  • Loan State Restrictions: Can only update loans in Partial_Application or Pending_Approval states
  • Full Editing: Complete editing is allowed for loans in pending states
  • Limited Editing: Loans in Active, Approved, or In_Arrears states have restricted updates
  • Cannot Update Core Terms: After disbursement, some fields become immutable
  • Branch and product must exist and be active
  • Account officer must be active and authorized

Code Examples

C# Example

Code Removed

Implementation details removed for security.

Contact support for implementation guidance.

TypeScript/JavaScript Example

interface UpdateLoanCommandRequest {
cmd: string;
data: {
accountName: string;
salesChannel?: string;
associationInformation: {
accountOfficerEncodedKey: string;
branchEncodedKey: string;
loanEncodedKey: string;
};
accountInformation: {
loanAmount: number;
interestRate: number;
loanTenor: number;
notes?: string;
firstRepaymentDate?: string;
moratoriumType: number;
moratoriumPeriod: number;
};
disbursementInformation: {
disbursementAmount: number;
disbursementDate: string;
disbursementMethod: string;
disbursmentChannelEncodedKey?: string;
};
comments?: string[];
};
}

async function updateLoan(loanData: UpdateLoanCommandRequest['data']): Promise<any> {
const commandRequest: UpdateLoanCommandRequest = {
cmd: 'UpdateLoanCommand',
data: loanData
};

const response = await fetch('/api/bpm/cmd', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${accessToken}`,
'X-Tenant-Id': tenantId
},
body: JSON.stringify(commandRequest)
});

if (!response.ok) {
throw new Error(`Loan update failed: ${response.statusText}`);
}

return await response.json();
}

// Usage
const loanData = {
accountName: 'Updated Business Loan - ABC Company',
salesChannel: 'BRANCH',
associationInformation: {
accountOfficerEncodedKey: '8a8e8e8e7f0000017f0000000001',
branchEncodedKey: '8a8e8e8e7f0000017f0000000002',
loanEncodedKey: '8a8e8e8e7f0000017f0000000099'
},
accountInformation: {
loanAmount: 550000.00,
interestRate: 14.5,
loanTenor: 30,
notes: 'Updated loan terms after review',
firstRepaymentDate: '2024-03-15T00:00:00Z',
moratoriumType: 1,
moratoriumPeriod: 2
},
disbursementInformation: {
disbursementAmount: 550000.00,
disbursementDate: '2024-02-15T00:00:00Z',
disbursementMethod: 'BankTransfer',
disbursmentChannelEncodedKey: '8a8e8e8e7f0000017f0000000003'
},
comments: ['Terms updated after credit review', 'Approved by manager']
};

const result = await updateLoan(loanData);
console.log('Loan updated:', result.data.loanId);

Notes

  • State-Dependent Updates: Different loan states allow different levels of modification
  • Partial/Pending States: Full editing capabilities available
  • Active/Approved States: Limited field updates allowed
  • Audit Trail: All updates are logged with user and timestamp information
  • Validation: System validates all changes against loan product rules and state constraints
  • For major term changes after approval, consider loan restructuring functionality