Retrieving the payment history of a loan account
Description
This web service returns the payment history of a loan account.
Definition
GET https://<domain>/services/apexrest/peer/v1/loanAccounts/payments/*
Parameters
The table given below provides details of the request parameters used by this web service:
Fields |
Type | Description |
---|---|---|
loanId* |
String | This is the ID of the loan account. It should be appended to the URL as shown in the sample request below |
startDate |
Date | This is the date from which you want to receive the loan payments. If null, the payments starting from the first payment are returned. |
endDate |
Date | This is the date till which you want to receive the loan payments. If null, the payments till the current system date are returned. |
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 |
---|---|---|---|---|
INVALID_INPUT |
Loan Account Id is null |
LOAN_ACCOUNT_ID_NULL |
Loan Account Id (loanId) is not specified in the Request URL |
400 |
INVALID_INPUT |
Unable to find the Loan Account |
LOAN_ACCOUNT_NOT_FOUND |
No record exists in the system for the Loan Account Id (loanId) specified in the Request URL. |
400 |
INVALID_INPUT |
Unknown Exception : <exception_message> |
UNKNOWN_EXCEPTION |
Unknown exception while parsing start or end date |
400 |
API_EXCEPTION |
<exception_message> |
NA |
If 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/payments/LAI-00000426?startDate=2013-12-18&endDate=2013-12-19
Sample response
This sample response contains the payments between the specified dates for the given loan account. The sample response that you will receive is as shown below:
{ "status":"SUCCESS", "response":[ ], "errorMessage":null, "errorCode":"NO_ERROR", "content":[ { "attributes":{ "type":"loan__Loan_Payment_Transaction__c", "url":"/services/data/v30.0/sobjects/loan__Loan_Payment_Transaction__c/a1dG00000003KOkIAM" }, "loan__Transaction_Time__c":"2013-12-19T08:40:06.000+0000", "loan__Reversed__c":false, "loan__Rejected__c":false, "loan__Cleared__c":true, "loan__Excess__c":0, "loan__Payment_Mode__c":"a2AG00000002bpKMAQ", "loan__Fees__c":0, "loan__Principal__c":96.72821928240741, "loan__Transaction_Date__c":"2013-12-19", "loan__Transaction_Amount__c":100, "Name":"LPT-000000618", "CreatedDate":"2014-07-01T07:40:06.000+0000", "Id":"a1dG00000003KOkIAM", "loan__Interest__c":3.2717807175925926, "loan__Payment_Mode__r":{ "attributes":{ "type":"loan__Payment_Mode__c", "url":"/services/data/v30.0/sobjects/loan__Payment_Mode__c/a2AG00000002bpKMAQ" }, "Name":"Cash", "Id":"a2AG00000002bpKMAQ" } }, { "attributes":{ "type":"loan__Loan_Payment_Transaction__c", "url":"/services/data/v30.0/sobjects/loan__Loan_Payment_Transaction__c/a1dG00000003MsZIAU" }, "loan__Transaction_Time__c":"2013-12-19T13:30:15.000+0000", "loan__Reversed__c":false, "loan__Rejected__c":false, "loan__Cleared__c":true, "loan__Excess__c":0, "loan__Payment_Mode__c":"a2AG00000002bpKMAQ", "loan__Fees__c":0, "loan__Principal__c":100, "loan__Transaction_Date__c":"2013-12-19", "loan__Transaction_Amount__c":100, "Name":"LPT-000000889", "CreatedDate":"2014-07-10T12:30:15.000+0000", "Id":"a1dG00000003MsZIAU", "loan__Interest__c":0, "loan__Payment_Mode__r":{ "attributes":{ "type":"loan__Payment_Mode__c", "url":"/services/data/v30.0/sobjects/loan__Payment_Mode__c/a2AG00000002bpKMAQ" }, "Name":"Cash", "Id":"a2AG00000002bpKMAQ" } }, { "attributes":{ "type":"loan__Loan_Payment_Transaction__c", "url":"/services/data/v30.0/sobjects/loan__Loan_Payment_Transaction__c/a1dG00000003QyLIAU" }, "loan__Transaction_Time__c":"2013-12-19T14:03:48.000+0000", "loan__Reversed__c":false, "loan__Rejected__c":false, "loan__Cleared__c":false, "loan__Excess__c":0, "loan__Payment_Mode__c":"a2AG00000002bpKMAQ", "loan__Fees__c":0, "loan__Principal__c":0, "loan__Transaction_Date__c":"2013-12-19", "loan__Transaction_Amount__c":100, "Name":"LPT-000000978", "CreatedDate":"2014-07-23T13:03:48.000+0000", "Id":"a1dG00000003QyLIAU", "loan__Interest__c":0, "loan__Payment_Mode__r":{ "attributes":{ "type":"loan__Payment_Mode__c", "url":"/services/data/v30.0/sobjects/loan__Payment_Mode__c/a2AG00000002bpKMAQ" }, "Name":"Cash", "Id":"a2AG00000002bpKMAQ" } }, { "attributes":{ "type":"loan__Loan_Payment_Transaction__c", "url":"/services/data/v30.0/sobjects/loan__Loan_Payment_Transaction__c/a1dG00000003LAGIA2" }, "loan__Transaction_Time__c":"2013-12-19T14:19:32.000+0000", "loan__Reversed__c":false, "loan__Rejected__c":false, "loan__Cleared__c":true, "loan__Excess__c":0, "loan__Payment_Mode__c":"a2AG00000002bpLMAQ", "loan__Fees__c":0, "loan__Principal__c":100, "loan__Transaction_Date__c":"2013-12-19", "loan__Transaction_Amount__c":100, "Name":"LPT-000000766", "CreatedDate":"2014-07-04T13:19:32.000+0000", "Id":"a1dG00000003LAGIA2", "loan__Interest__c":0, "loan__Payment_Mode__r":{ "attributes":{ "type":"loan__Payment_Mode__c", "url":"/services/data/v30.0/sobjects/loan__Payment_Mode__c/a2AG00000002bpLMAQ" }, "Name":"ACH", "Id":"a2AG00000002bpLMAQ" } }, { "attributes":{ "type":"loan__Loan_Payment_Transaction__c", "url":"/services/data/v30.0/sobjects/loan__Loan_Payment_Transaction__c/a1dG00000003LA6IAM" }, "loan__Transaction_Time__c":"2013-12-19T14:19:13.000+0000", "loan__Reversed__c":false, "loan__Rejected__c":false, "loan__Cleared__c":true, "loan__Excess__c":0, "loan__Payment_Mode__c":"a2AG00000002bpKMAQ", "loan__Fees__c":0, "loan__Principal__c":100, "loan__Transaction_Date__c":"2013-12-19", "loan__Transaction_Amount__c":100, "Name":"LPT-000000764", "CreatedDate":"2014-07-04T13:19:13.000+0000", "Id":"a1dG00000003LA6IAM", "loan__Interest__c":0, "loan__Payment_Mode__r":{ "attributes":{ "type":"loan__Payment_Mode__c", "url":"/services/data/v30.0/sobjects/loan__Payment_Mode__c/a2AG00000002bpKMAQ" }, "Name":"Cash", "Id":"a2AG00000002bpKMAQ" } }, { "attributes":{ "type":"loan__Loan_Payment_Transaction__c", "url":"/services/data/v30.0/sobjects/loan__Loan_Payment_Transaction__c/a1dG00000003LABIA2" }, "loan__Transaction_Time__c":"2013-12-19T14:19:24.000+0000", "loan__Reversed__c":false, "loan__Rejected__c":false, "loan__Cleared__c":true, "loan__Excess__c":0, "loan__Payment_Mode__c":"a2AG00000002bpLMAQ", "loan__Fees__c":0, "loan__Principal__c":100, "loan__Transaction_Date__c":"2013-12-19", "loan__Transaction_Amount__c":100, "Name":"LPT-000000765", "CreatedDate":"2014-07-04T13:19:24.000+0000", "Id":"a1dG00000003LABIA2", "loan__Interest__c":0, "loan__Payment_Mode__r":{ "attributes":{ "type":"loan__Payment_Mode__c", "url":"/services/data/v30.0/sobjects/loan__Payment_Mode__c/a2AG00000002bpLMAQ" }, "Name":"ACH", "Id":"a2AG00000002bpLMAQ" } } ] }