Rescheduling a loan
Description
This web service reschedules a lending account, commits changes to the database and returns the updated lending account.
Definition
POST https://<domain>/services/apexrest/peer/v1/loanAccounts/reschedule
Parameters
The table given below provides details of the request parameters used by this web service:
Fields | Type | Description |
---|---|---|
loanId* |
String |
|
transactionDate |
Date |
|
repaymentStartDate |
Date |
|
interestRate |
Decimal |
|
interestOnlyPeriod |
Integer |
|
frequencyOfPayment |
String |
|
noOfInstallments |
Integer |
|
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 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 Rrequest. |
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 |
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:
https://na11.salesforce.com/services/apexrest/peer/v1/loanAccounts/Reschedule
{
"transactionDate": "2016-01-17",
"repaymentStartDate": "2016-02-28",
"interestRate": 15,
"interestOnlyPeriod": 1,
"frequencyOfPayment": "Weekly",
"noOfInstallments": 18
}
Sample response
The sample response contains the updated loan application. The sample response is as shown below:
{ "status": "SUCCESS", "rowNumber": -1, "response": [], "errorNumber": 0, "errorMessage": null, "errorCode": "NO_ERROR", "content": [ { "attributes": { "type": "loan__Loan_Account__c", "url": "/services/data/v32.0/sobjects/loan__Loan_Account__c/a3G37000000CsWqEAK" }, "Id": "a3G37000000CsWqEAK", "Name": "LAI-00003283", "loan__Contact__c": "0033700000206jbAAA", "loan__Investment_Product_loan__c": false, "loan__Actual_Interest_Only_Payments__c": false, "loan__Principal_Paid__c": 0, "loan__Interest_Paid__c": 0, "loan__Principal_Interest_EMI_Generated_On_Req__c": false, "loan__Recalculate_Interest_Flag__c": false, "loan__Fees_Paid__c": 0, "loan__Invalid_Data__c": false, "loan__Last_Accrual_Date__c": "2016-01-15", "loan__Payoff_Fee_Indicator__c": false, "loan__Excess__c": 0, "loan__Fee_Set__c": "a2i37000000L2pyAAC", "loan__Expected_Disbursal_Date__c": "2016-01-12", "loan__Next_Installment_Date__c": "2016-02-28", "loan__Due_Day__c": 28, "loan__Disbursal_Date__c": "2016-01-12", "loan__Index_Rate__c": 0,
"loan__Margin_Rate__c": 0,
"loan__Pre_Bill_Days__c": 0,
"loan__Expected_Repayment_Start_Date__c": "2016-02-12",
"loan__Repayment_Procedure__c": "Equal Monthly Installments",
"loan__Loan_Status__c": "Active - Good Standing",
"loan__Term_Cur__c": 18,
"loan__Maturity_Date_Current__c": "2017-07-28",
"loan__Number_of_Installments__c": 5,
"loan__Frequency_of_Loan_Payment__c": "Monthly",
"loan__Principal_Remaining__c": 10000,
"loan__Principal_Adjustment__c": 0,
"loan__First_Installment_Date__c": "2016-02-12",
"loan__Remaining_Loan_Amount__c": 0,
"loan__Principal_Adjustment_Subtract__c": 0,
"loan__Interest_Rate__c": 15,
"loan__Interest_Calculation_Method__c": "Declining Balance",
"loan__Interest_Remaining__c": 6.666666666666667,
"loan__Interest_estimated__c": 200.89,
"loan__Interest_Waived__c": 0,
"loan__Interest_Only_Period__c": 1,
"loan__Balloon_Payment__c": 0,
"loan__Loan_Amount__c": 10000,
"loan__Loan_Product_Name__c": "a3R37000000Gpc3EAC",
"loan__Number_of_Days_Overdue__c": 0,
"loan__Metro2_Account_highest_bal_amount__c": 10000,
"loan__Time_Counting_Method__c": "Month And Days",
"loan__Total_Amount_Overdue__c": 0,
"loan__Branch__c": "a3k370000004DsKAAU",
"loan__Accrual_Stop_Indicator__c": false,
"loan__Payment_Amount__c": 2040.18,
"loan__Pmt_Amt_Cur__c": 131.67,
"loan__APR__c": 0,
"loan__Last_Transaction_Timestamp__c": "2016-01-15T10:19:41.000+0000",
"loan__Last_Transaction_Id__c": "a3o37000000HvwHAAS",
"loan__Last_Transaction_Type__c": "Reschedule",
"loan__Pay_Off_Amount_As_Of_Today__c": 10006.67,
"loan__Total_Due_Charges__c": 0,
"loan__Interest_Accrued_Not_Due__c": 3.888888888888889,
"loan__Fees_Remaining__c": 0,
"loan__Accrual_Start_Days__c": 0,
"loan__Next_Due_Generation_Date__c": "2016-02-28",
"loan__Write_off_Tolerance_Amount__c": 0,
"loan__Reserve_Amount_for_Next_Due__c": 0,
"loan__Delinquency_Grace_Days__c": 0,
"loan__Delinquent_Amount__c": 0,
"loan__Oldest_Due_Date__c": "2016-02-28",
"loan__Previous_Installment_Date__c": "2016-01-15",
"loan__Last_Payment_Amount__c": 0,
"loan__Rate_Change_Dt_Last__c": "2016-01-15",
"loan__Rate_Change_Dt_Next__c": "3000-12-31",
"loan__Interest_Rate_Last__c": 8,
"loan__Accrual_Start_Date__c": "2016-01-12",
"loan__Repayments_Count__c": 0,
"loan__Product_Type__c": "Loan",
"loan__Credit_Limit_Current__c": 0,
"loan__Minimum_Draw_Amount__c": 0,
"loan__Maximum_Draw_Amount__c": 0,
"loan__Draw_Term_Payment_Percent__c": 0,
"loan__Minimum_Due_Amount_On_Billing__c": 0,
"loan__Repayment_Term_Payment_Percent__c": 0,
"loan__Cleared_Disbursal_Txn_Count__c": 1,
"loan__Contractual_Interest_Rate__c": 8,
"loan__Pre_Paid_Interest_Amount__c": 0,
"loan__Funding_in_Tranches__c": false,
"loan__Repayment_Start_Basis__c": "Full Disbursal",
"loan__Amortization_Schedule_Generated__c": true,
"loan__Draw_Period_End_Date__c": "2016-01-12",
"loan__Disbursal_Status__c": "Fully Disbursed",
"loan__Disbursal_Amount__c": 10000,
"loan__Total_Amount_Paid__c": 0,
"loan__Disbursed_Amount__c": 10000,
"loan__Last_Disbursal_Amount__c": 10000,
"loan__ACH_On__c": false,
"loan__Change_Recurring_ACH_Terms__c": false,
"loan__Last_Disbursal_Date__c": "2016-01-12",
"loan__Is_Rescheduled__c": true,
"loan__Protect_Enabled__c": false,
"loan__Protect_fee_amount__c": 0,
"loan__la_delinquency_flag__c": false,
"loan__Repayment_Schedule_Summary__r": {
"totalSize": 2,
"done": true,
"records": [
{
"attributes": {
"type": "loan__Repayment_Schedule_Summary__c",
"url": "/services/data/v32.0/sobjects/loan__Repayment_Schedule_Summary__c/a4A37000000L3wWEAS"
},
"loan__RSS_Loan_Account__c": "a3G37000000CsWqEAK",
"Id": "a4A37000000L3wWEAS",
"Name": "RSS-0000000332",
"loan__RSS_ID__c": "0",
"loan__RSS_No_Of_Pmts__c": 1,
"loan__RSS_Primary_flag__c": true,
"loan__RSS_Repayment_Amt__c": 131.66666666666666,
"loan__RSS_Repayment_Dt__c": "2016-02-28",
"loan__RSS_Seq__c": 1
},
{
"attributes": {
"type": "loan__Repayment_Schedule_Summary__c",
"url": "/services/data/v32.0/sobjects/loan__Repayment_Schedule_Summary__c/a4A37000000L3wXEAS"
},
"loan__RSS_Loan_Account__c": "a3G37000000CsWqEAK", "Id": "a4A37000000L3wXEAS",
"Name": "RSS-0000000333",
"loan__RSS_ID__c": "1",
"loan__RSS_No_Of_Pmts__c": 17, "loan__RSS_Primary_flag__c": true, "loan__RSS_Repayment_Dt__c": "2016-03-28", "loan__RSS_Seq__c": 2 } ] }, "loan__Contact__r": { "attributes": { "type": "Contact", "url": "/services/data/v32.0/sobjects/Contact/0033700000206jbAAA" }, "Id": "0033700000206jbAAA", "Name": "Tim Barr" }, "loan__Loan_Product_Name__r": { "attributes": { "type": "loan__Loan_Product__c", "url": "/services/data/v32.0/sobjects/loan__Loan_Product__c/a3R37000000Gpc3EAC" }, "Id": "a3R37000000Gpc3EAC", "Name": "Test Loan Product", "loan__Max_Loan_Amount__c": 100000, "loan__Holiday_Shift__c": "None" } } ]}