Remove Loan Guarantor
Overview
Removes a guarantor from an existing loan account.
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": "RemoveLoanGuarantorCommand",
"data": {
"loanAccountId": 12345,
"clientId": 67890
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| cmd | string | Yes | Must be "RemoveLoanGuarantorCommand" |
| data | object | Yes | Guarantor removal data |
| ↳ loanAccountId | integer | Yes | Loan account ID |
| ↳ clientId | integer | Yes | Client/Customer ID of guarantor to remove |
Response
Success Response (200 OK)
{
"success": true,
"message": "Guarantor removed successfully",
"data": {
"loanId": "LA-2024-00001",
"guarantorId": "CUST-67890",
"removedAt": "2024-01-20T11:00:00Z",
"removedBy": "officer@bank.com",
"reason": "Guarantor request"
}
}
Status Codes
| Code | Description |
|---|---|
| 200 | Guarantor removed successfully |
| 400 | Invalid request or removal not allowed |
| 401 | Unauthorized |
| 404 | Loan or guarantor not found |
| 409 | Removal would violate guarantee requirements |
| 500 | Internal server error |
Business Rules
- Cannot remove if it would breach minimum guarantee requirements
- Removal may require supervisory approval
- Cannot remove after loan default
- Guarantor notified of removal
Code Examples
C# Example
public async Task<ApiResponse> RemoveLoanGuarantorAsync(string loanId, string guarantorId, string reason)
{
var request = new { loanId, guarantorId, reason };
var json = JsonSerializer.Serialize(request);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await _httpClient.PostAsync("/api/administration/loan/guarantor/remove", content);
response.EnsureSuccessStatusCode();
return await JsonSerializer.DeserializeAsync<ApiResponse>(await response.Content.ReadAsStreamAsync());
}
TypeScript Example
async function removeLoanGuarantor(loanId: string, guarantorId: string, reason: string): Promise<ApiResponse> {
const response = await fetch('/api/administration/loan/guarantor/remove', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${accessToken}`,
'X-Tenant-Id': tenantId
},
body: JSON.stringify({ loanId, guarantorId, reason })
});
return await response.json();
}
Notes
- Removal logged in audit trail
- Guarantor notified automatically
- May require replacement guarantor if minimum coverage required
- Cannot be undone once processed