Settling or Selling a Loan
Description
This REST API is used to sell a loan or settle a loan so that it moves to Closed-Obligations Met status. The API creates an LPT for the balance amount on the loan.
Definition
https://<domain>/services/apexrest/peer/v1/loanAccounts/settleLoan
Parameters
The table given below provides details of the request parameters used by this web service:
Fields |
Type |
Description |
---|---|---|
loanAccountId |
String |
|
paymentType |
String |
This reflects the status as per which the LPT is created.
|
Error Messages
When you use this web service you can receive the possible error messages as shown in the table below:
Error code |
Error Message |
System.Label |
Reason |
HTTP Status Code |
---|---|---|---|---|
API_EXCEPTION |
Loan Settlement is allowed only for loan status Active - Good Standing, Active - Bad Standing, Active - Matured, and Closed- Written Off. | CL019689 |
If loan contract status is not Active or Closed-Written Off. | 500 |
INVALID_INPUT |
Sample Request
The sample request to be sent is as shown below:
https://na35.salesforce.com/services/apexrest/peer/v1/loanAccounts/settleLoan
{
"loanAccountId":"a4p410000000SRZ",
"paymentType":"Sold"
}
Sample Response
{
"status": "SUCCESS",
"rowNumber": -1,
"response": [],
"errorNumber": 0,
"errorMessage": null,
"errorCode": "NO_ERROR",
"content": []
}