Changing the interest rate
Description
This web service changes the rate of interest on a lending account, commits changes to the database and returns the updated lending account.
Definition
https://<domain>/services/apexrest/peer/v1/loanAccounts/changeInterest
Parameters
The table given below provides details of the request parameters used by this web service:
Fields |
Type |
Description |
---|---|---|
loanId* |
String |
For example, /v1/ loanAccounts/changeInterest /<loanId|loanName>.
|
transactionDate |
Date |
|
interestRate* |
Decimal |
|
Error messages
When you post a 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 |
---|---|---|---|---|
INVALID_INPUT |
Unable to parse the Request parameters. |
UNABLE_PARSE_REQ_PARAMS |
If an error occurs while parsing request parameters. |
400 |
INVALID_INPUT |
Unknown Exception : <exception_message> |
UNKNOWN_EXCEPTION |
Unknown exception while parsing request parameters. |
400 |
INVALID_INPUT |
Loan Account Id is null. |
LOAN_ACCOUNT_ID_NULL |
Loan Account Id for Loan is not specified in the request parameters. |
400 |
INVALID_INPUT |
No parameters specified in the JSON body request. |
INVALID_JSON_BODY_IN_POST_REQUEST |
Empty JSON body was passed in the HTTP Post Request. |
400 |
INVALID_INPUT |
Unable to find the Loan Account. |
LOAN_ACCOUNT_NOT_FOUND |
No record exists in the system for Loan Id (loanId) specified in the request parameters for Loan Account. |
400 |
INVALID_INPUT |
Interest Rate cannot be a negative value. |
NEGATIVE_INTEREST_RATE |
Value of the rate of interest specified in the request is negative. |
400 |
API_EXCEPTION |
<exception_message> |
NA |
If any validation fails or any unexpected error occurs during the processing of the request, system will raise the exception. |
500 |
Sample request
The sample request to be sent is as shown below:
{
"interestRate": 8,
"transactionDate": "2014-11-28"
}
Sample response
The sample response contains the updated loan application with change of Interest Rate. The sample response is as shown below:
{
"status": "SUCCESS",
"response": [],
"errorMessage": null,
"errorCode": "NO_ERROR",
"content": [
{
"attributes": {
"type": "loan__Loan_Account__c",
"url": "/services/data/v32.0/sobjects/loan__Loan_Account__c/a1WG00000050j5pMAA"
},
"loan__Index_Rate__c": 0,
"loan__Interest_Accrued_Not_Due__c": 0,
"loan__Payment_Amount__c": 865.77,
"loan__ACH_Frequency__c": "Monthly",
"loan__Disbursed_Amount__c": 9900,
"loan__Accrual_Start_Date__c": "2014-07-27",
"loan__Expected_Disbursal_Date__c": "2014-07-27",
"loan__Change_Recurring_ACH_Terms__c": false,
"loan__Fees_Paid__c": 495,
"loan__Pay_Off_Amount_As_Of_Today__c": 9813.085,
"loan__ACH_Next_Debit_Date__c": "2014-08-27",
"loan__Expected_Repayment_Start_Date__c": "2014-08-27",
"loan__Previous_Installment_Date__c": "2014-11-27",
"loan__Repayments_Count__c": 8,
"loan__Fees_Remaining__c": 0,
"loan__Last_Payment_Date__c": "2014-08-28",
"loan__Interest_Rate__c": 8,
"loan__Oldest_Due_Date__c": "2014-11-30",
"loan__Last_Transaction_Timestamp__c": "2014-11-28T17:38:45.000+0000",
"loan__Total_Amount_Overdue__c": 0,
"loan__Last_Accrual_Date__c": "2014-11-28",
"loan__Reserve_Amount_for_Next_Due__c": 0,
"loan__Last_Payment_Amount__c": 101.44,
"loan__Minimum_Due_Amount_On_Billing__c": 0,
"loan__Interest_Paid__c": 76.73,
"loan__Last_Disbursal_Amount__c": 9900,
"loan__Accrual_Stop_Indicator__c": false,
"Id": "a1WG00000050j5pMAA",
"loan__Interest_Calculation_Method__c": "Declining Balance",
"loan__Delinquency_Grace_Days__c": 0,
"loan__Time_Counting_Method__c": "Month And Days",
"loan__First_Installment_Date__c": "2014-08-27",
"loan__Ach_Debit_Day__c": 27,
"loan__Last_Disbursal_Date__c": "2014-07-27",
"loan__Term_Cur__c": 18,
"loan__Minimum_Draw_Amount__c": 0,
"loan__Fee_Set__c": "a12G0000001MbEDIA0",
"loan__Repayment_Procedure__c": "Equal Monthly Installments",
"loan__Total_Due_Charges__c": 0,
"loan__Excess__c": 0,
"loan__Disbursal_Date__c": "2014-07-27",
"loan__Repayment_Term_Payment_Percent__c": 0,
"loan__Disbursal_Status__c": "Fully Disbursed",
"loan__Product_Type__c": "Loan",
"loan__Metro2_Account_highest_bal_amount__c": 9900,
"loan__Principal_Remaining__c": 9813.09,
"loan__Maturity_Date_Current__c": "2016-04-30",
"loan__Loan_Status__c": "Active - Good Standing",
"loan__Rate_Change_Dt_Last__c": "2014-11-28",
"loan__Funding_in_Tranches__c": false,
"loan__Interest_Rate_Last__c": 8,
"loan__Margin_Rate__c": 0,
"loan__Principal_Paid__c": 86.92,
"loan__Pmt_Amt_Cur__c": 94.62,
"loan__Accrual_Start_Days__c": 0,
"loan__Invalid_Data__c": false,
"loan__Loan_Amount__c": 9900,
"loan__Cleared_Disbursal_Txn_Count__c": 1,
"loan__Principal_Adjustment__c": 0,
"loan__Rate_Change_Dt_Next__c": "3000-12-31",
"loan__Next_Installment_Date__c": "2014-11-30",
"loan__Number_of_Days_Overdue__c": 0,
"loan__Due_Day__c": 30,
"loan__Interest_Remaining__c": 217.52456833333332,
"loan__Contractual_Interest_Rate__c": 9,
"loan__Pre_Paid_Interest_Amount__c": 0,
"loan__Loan_Product_Name__r": {
"attributes": {
"type": "loan__Loan_Product__c",
"url": "/services/data/v32.0/sobjects/loan__Loan_Product__c/a1gG00000019OFeIAM"
},
"Name": "Simple Loan Product",
"Id": "a1gG00000019OFeIAM",
"loan__Holiday_Shift__c": "None"
},
"loan__Pre_Bill_Days__c": 0,
"loan__ACH_On__c": true,
"loan__Draw_Term_Payment_Percent__c": 0,
"loan__Principal_Adjustment_Subtract__c": 0,
"loan__Metro2_First_Delinquency_Date__c": "2014-08-27",
"loan__Payoff_Fee_Indicator__c": false,
"loan__Number_of_Installments__c": 12,
"loan__Frequency_of_Loan_Payment__c": "Monthly",
"Name": "LAI-00024354",
"loan__Maximum_Draw_Amount__c": 0,
"loan__Next_Due_Generation_Date__c": "2014-11-30",
"loan__ACH_End_Date__c": "2015-07-27",
"loan__Loan_Product_Name__c": "a1gG00000019OFeIAM",
"loan__Write_off_Tolerance_Amount__c": 0,
"loan__Credit_Limit_Current__c": 0,
"loan__Branch__c": "a1zG0000000LezuIAC",
"loan__Delinquent_Amount__c": 0,
"loan__Last_Transaction_Type__c": "Rate Change",
"loan__Interest_Only_Period__c": 11,
"loan__Balloon_Payment__c": 0
}
]
}