Retrieving the amortization schedule of a loan account
Description
This web service returns the amortization or repayment schedule of a loan account.
Definition
GET https://<domain>/services/apexrest/peer/v1/loanAccounts/amzSchedule/*
Parameters
The table given below provides details of the request parameter used by this web service:
Field | Type | Description |
---|---|---|
loanId* | String |
|
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 | Loan Account Id is null | LOAN_ACCOUNT_ID_NULL | You will receive this error if the loan account Id (loanId) is not specified in the Request URL. | 400 |
INVALID_INPUT | Unable to find the Loan Account | LOAN_ACCOUNT_NOT_FOUND | You will receive this error if no record exists in the system for the Loan Account Id (loanId) specified in the Request URL | 400 |
API_EXCEPTION | <exception_message> | NA | You will receive this error if the any validation fails or any unexpected error occurs during the processing of the request, the 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/amzSchedule/a1WG0000004hI9QMAU
Sample response
This sample response contains the details of the amortization or repayment schedule returned by the API (showing only 3 records as an example). The actual response will return all the number of installments.
The sample request to be sent is as shown below:
{ "status":"SUCCESS", "response":[ ], "errorMessage":null, "errorCode":"NO_ERROR", "content":[ { "attributes":{ "type":"loan__Repayment_Schedule__c", "url":"/services/data/v30.0/sobjects/loan__Repayment_Schedule__c/a2LG00000002scaMAA" }, "loan__Is_Partially_Paid__c":false, "loan__Interest_Accrued_Not_Due__c":0, "loan__Unpaid_Interest__c":37.4, "loan__Total_Paid_Fees__c":0, "loan__Is_Billed__c":false, "loan__Due_Date__c":"2014-07-13", "loan__Total_Installment__c":855.67, "loan__Id__c":"1", "LastModifiedDate":"2014-08-28T19:55:52.000+0000", "loan__Paid_Interest_On_Overdue__c":0, "loan__isPaid__c":false, "loan__Transaction_Amount__c":0, "loan__Unpaid_Installment__c":855.67, "SystemModstamp":"2014-08-28T19:55:52.000+0000", "loan__Due_Interest__c":37.4, "loan__Unpaid_Fees__c":0, "loan__Barcode_Type__c":"Code128", "loan__Balance__c":4181.730025275332, "loan__Unpaid_Overdue_Interest__c":0, "LastModifiedById":"005G0000004JzfEIAS", "loan__Paid_Total__c":0, "loan__Past_Due_Date__c":false, "loan__Unpaid_Principal__c":818.27, "loan__Is_Archived__c":false, "Name":"RSI-0000037322", "loan__Paid_Interest__c":0, "loan__Total_Due_Fees__c":0, "loan__Due_Principal__c":818.2699747246676, "CreatedById":"005G0000004JzfEIAS", "CreatedDate":"2014-08-28T19:55:52.000+0000", "IsDeleted":false, "Id":"a2LG00000002scaMAA", "loan__Paid_Principal__c":0, "loan__Due_Interest_On_Overdue__c":0, "loan__Loan_Account__c":"a1WG0000004hI9QMAU", "loan__Paid_Fees__c":0 }, { "attributes":{ "type":"loan__Repayment_Schedule__c", "url":"/services/data/v30.0/sobjects/loan__Repayment_Schedule__c/a2LG00000002scbMAA" }, "loan__Is_Partially_Paid__c":false, "loan__Interest_Accrued_Not_Due__c":0, "loan__Unpaid_Interest__c":32.32, "loan__Total_Paid_Fees__c":0, "loan__Is_Billed__c":false, "loan__Due_Date__c":"2014-08-13", "loan__Total_Installment__c":855.67, "loan__Id__c":"2", "LastModifiedDate":"2014-08-28T19:55:52.000+0000", "loan__Paid_Interest_On_Overdue__c":0, "loan__isPaid__c":false, "loan__Transaction_Amount__c":0, "loan__Unpaid_Installment__c":855.67, "SystemModstamp":"2014-08-28T19:55:52.000+0000", "loan__Due_Interest__c":32.32, "loan__Unpaid_Fees__c":0, "loan__Barcode_Type__c":"Code128", "loan__Balance__c":3358.3800505506647, "loan__Unpaid_Overdue_Interest__c":0, "LastModifiedById":"005G0000004JzfEIAS", "loan__Paid_Total__c":0, "loan__Past_Due_Date__c":false, "loan__Unpaid_Principal__c":823.35, "loan__Is_Archived__c":false, "Name":"RSI-0000037323", "loan__Paid_Interest__c":0, "loan__Total_Due_Fees__c":0, "loan__Due_Principal__c":823.3499747246676, "CreatedById":"005G0000004JzfEIAS", "CreatedDate":"2014-08-28T19:55:52.000+0000", "IsDeleted":false, "Id":"a2LG00000002scbMAA", "loan__Paid_Principal__c":0, "loan__Due_Interest_On_Overdue__c":0, "loan__Loan_Account__c":"a1WG0000004hI9QMAU", "loan__Paid_Fees__c":0 }, { "attributes":{ "type":"loan__Repayment_Schedule__c", "url":"/services/data/v30.0/sobjects/loan__Repayment_Schedule__c/a2LG00000002sccMAA" }, "loan__Is_Partially_Paid__c":false, "loan__Interest_Accrued_Not_Due__c":0, "loan__Unpaid_Interest__c":25.96, "loan__Total_Paid_Fees__c":0, "loan__Is_Billed__c":false, "loan__Due_Date__c":"2014-09-13", "loan__Total_Installment__c":855.67, "loan__Id__c":"3", "LastModifiedDate":"2014-08-28T19:55:52.000+0000", "loan__Paid_Interest_On_Overdue__c":0, "loan__isPaid__c":false, "loan__Transaction_Amount__c":0, "loan__Unpaid_Installment__c":855.67, "SystemModstamp":"2014-08-28T19:55:52.000+0000", "loan__Due_Interest__c":25.96, "loan__Unpaid_Fees__c":0, "loan__Barcode_Type__c":"Code128", "loan__Balance__c":2528.670075825997, "loan__Unpaid_Overdue_Interest__c":0, "LastModifiedById":"005G0000004JzfEIAS", "loan__Paid_Total__c":0, "loan__Past_Due_Date__c":false, "loan__Unpaid_Principal__c":829.71, "loan__Is_Archived__c":false, "Name":"RSI-0000037324", "loan__Paid_Interest__c":0, "loan__Total_Due_Fees__c":0, "loan__Due_Principal__c":829.7099747246676, "CreatedById":"005G0000004JzfEIAS", "CreatedDate":"2014-08-28T19:55:52.000+0000", "IsDeleted":false, "Id":"a2LG00000002sccMAA", "loan__Paid_Principal__c":0, "loan__Due_Interest_On_Overdue__c":0, "loan__Loan_Account__c":"a1WG0000004hI9QMAU", "loan__Paid_Fees__c":0 }, ] }