Skip to main content

Reject Loan Account

Overview

Rejects a loan application with documented reasons.

Endpoint

POST /api/bpm/cmd

Request Headers

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

Request Body

{
"cmd": "RejectLoanCommand",
"data": {
"accountEncodedKey": "LN-2024-001234",
"comment": "Insufficient credit history - Unable to verify income sources"
}
}

Parameters

ParameterTypeRequiredDescription
cmdstringYesMust be "RejectLoanCommand"
dataobjectYesRejection data
↳ accountEncodedKeystringYesLoan account identifier (EncodedKey or AccountNumber)
↳ commentstringNoRejection reason and comments

Response

Success Response (200 OK)

{
"success": true,
"message": "Loan rejected successfully",
"data": {
"loanId": "LA-2024-00001",
"status": "Rejected",
"rejectionDate": "2024-01-15T14:00:00Z",
"rejectedBy": "manager@bank.com",
"rejectionReason": "Insufficient collateral",
"rejectionComments": "Loan-to-value ratio does not meet requirements"
}
}

Status Codes

CodeDescription
200Loan rejected successfully
400Invalid request
401Unauthorized
403Insufficient authority
404Loan not found
409Loan already processed
500Internal server error

Business Rules

  • Loan must be in PendingApproval status
  • Rejection reason is mandatory
  • Customer notified automatically
  • Audit trail maintained
  • Loan cannot be modified after rejection

Code Examples

C# Example

public async Task<RejectionResponse> RejectLoanAsync(string loanId, string reason, string comments = null)
{
var request = new { loanId, rejectionReason = reason, rejectionComments = comments };
var json = JsonSerializer.Serialize(request);
var content = new StringContent(json, Encoding.UTF8, "application/json");

var response = await _httpClient.PostAsync("/api/administration/loan/reject", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
return JsonSerializer.Deserialize<ApiResponse<RejectionResponse>>(result).Data;
}

TypeScript Example

async function rejectLoan(loanId: string, reason: string, comments?: string): Promise<RejectionResponse> {
const response = await fetch('/api/administration/loan/reject', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${accessToken}`,
'X-Tenant-Id': tenantId
},
body: JSON.stringify({ loanId, rejectionReason: reason, rejectionComments: comments })
});

const result = await response.json();
return result.data;
}

Notes

  • Rejection reason required for audit and customer communication
  • Customer receives formal rejection notification
  • Rejection cannot be undone (new application required)
  • Loan officer notified of rejection