Reject Loan Account
Overview
Rejects a loan application with documented reasons.
Endpoint
POST /api/bpm/cmd
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token for authentication |
| Content-Type | string | Yes | Must be application/json |
| X-Tenant-Id | string | Yes | Tenant identifier |
Request Body
{
"cmd": "RejectLoanCommand",
"data": {
"accountEncodedKey": "LN-2024-001234",
"comment": "Insufficient credit history - Unable to verify income sources"
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| cmd | string | Yes | Must be "RejectLoanCommand" |
| data | object | Yes | Rejection data |
| ↳ accountEncodedKey | string | Yes | Loan account identifier (EncodedKey or AccountNumber) |
| ↳ comment | string | No | Rejection 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
| Code | Description |
|---|---|
| 200 | Loan rejected successfully |
| 400 | Invalid request |
| 401 | Unauthorized |
| 403 | Insufficient authority |
| 404 | Loan not found |
| 409 | Loan already processed |
| 500 | Internal 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