Skip to main content

Remove Loan Guarantor

Overview

Removes a guarantor from 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": "RemoveLoanGuarantorCommand",
"data": {
"loanAccountId": 12345,
"clientId": 67890
}
}

Parameters

ParameterTypeRequiredDescription
cmdstringYesMust be "RemoveLoanGuarantorCommand"
dataobjectYesGuarantor removal data
↳ loanAccountIdintegerYesLoan account ID
↳ clientIdintegerYesClient/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

CodeDescription
200Guarantor removed successfully
400Invalid request or removal not allowed
401Unauthorized
404Loan or guarantor not found
409Removal would violate guarantee requirements
500Internal 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