Add Loan Guarantor
Overview
Adds a guarantor to 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": "AddLoanGuarantorCommand",
"data": {
"loanAccountId": 12345,
"clientId": 67890,
"relationship": "Business Partner"
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| cmd | string | Yes | Must be "AddLoanGuarantorCommand" |
| data | object | Yes | Guarantor data |
| ↳ loanAccountId | integer | Yes | Loan account ID |
| ↳ clientId | integer | Yes | Client/Customer ID of guarantor |
| ↳ relationship | string | Yes | Relationship to borrower |
Response
Success Response (200 OK)
{
"success": true,
"message": "Guarantor added successfully",
"data": {
"loanId": "LA-2024-00001",
"guarantorId": "CUST-67890",
"guarantorName": "Alice Johnson",
"guaranteeAmount": 25000.00,
"guaranteeType": "Partial",
"relationshipToBorrower": "Business Partner",
"status": "PendingAcceptance",
"addedAt": "2024-01-20T10:00:00Z",
"addedBy": "officer@bank.com"
}
}
Status Codes
| Code | Description |
|---|---|
| 200 | Guarantor added successfully |
| 400 | Invalid request or guarantor ineligible |
| 401 | Unauthorized |
| 404 | Loan or guarantor customer not found |
| 409 | Guarantor already exists for this loan |
| 500 | Internal server error |
Business Rules
- Guarantor must be an existing customer
- Guarantor must have good credit standing
- Guarantor cannot be the borrower
- Total guarantees may have minimum requirements
- Guarantor acceptance may be required
Code Examples
C# Example
public async Task<GuarantorResponse> AddLoanGuarantorAsync(AddGuarantorRequest request)
{
var json = JsonSerializer.Serialize(request);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await _httpClient.PostAsync("/api/administration/loan/guarantor/add", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
return JsonSerializer.Deserialize<ApiResponse<GuarantorResponse>>(result).Data;
}
TypeScript Example
async function addLoanGuarantor(request: AddGuarantorRequest): Promise<GuarantorResponse> {
const response = await fetch('/api/administration/loan/guarantor/add', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${accessToken}`,
'X-Tenant-Id': tenantId
},
body: JSON.stringify(request)
});
const result = await response.json();
return result.data;
}
Notes
- Guarantor notification sent automatically
- Guarantor must accept guarantee before loan disbursement
- Multiple guarantors can be added to a loan
- Guarantee amount contributes to security coverage