Retrieving the loan application of a loan account
Description
This web service retrieves the loan application of a particular loan account.
Definition
https://<domain>/services/apexrest/peer/v1/loanAccounts/getLoanApp/*
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 | Unable to parse the Request parameters. |
UNABLE_PARSE_REQ_PARAMS |
You will receive this error if any error occurs while parsing the Request URL. |
400 |
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 |
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 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/getLoanApp/LAI-00014526
Sample response
This sample response contains the loan application for the given loan account. The sample response is as shown below:
{
"status": "SUCCESS",
"response": [],
"errorMessage": null,
"errorCode": "NO_ERROR",
"content": [
{
"attributes": {
"type": "peer__Loan_Application__c",
"url": "/services/data/v30.0/sobjects/peer__Loan_Application__c/a2qG00000009Q9uIAE" },
"peer__Stage__c": "New",
"peer__Application_Date__c": "2014-01-03",
"peer__Remaining_Requested_Amount__c": 15300,
"peer__Disbursal_Date__c": "2014-07-30",
"peer__Borrower__r": {
"attributes": {
"type": "Account",
"url": "/services/data/v30.0/sobjects/Account/001G000001KY8byIAD" },
"peer__Nickname__c": "Shivam",
"Id": "001G000001KY8byIAD" },
"peer__First_Payment_Date__c": "2014-08-30",
"peer__Loan_Purpose_1__c": "a1hG0000000JR1tIAG",
"peer__Amount_Funded__c": 0,
"peer__Amount_Time_Left__c": "$15300 / 208 Days -10 Hours -48 Minutes",
"peer__Expiry_Date__c": "2014-07-30T00:00:00.000+0000",
"peer__Loan_Purpose_1__r": {
"attributes": {
"type": "loan__Loan_Purpose__c",
"url": "/services/data/v30.0/sobjects/loan__Loan_Purpose__c/a1hG0000000JR1tIAG" },
"Name": "Family",
"Id": "a1hG0000000JR1tIAG" },
"peer__Interest_Rate__c": 9,
"peer__Amount_In_Funding__c": 0,
"peer__Attractiveness_Parameter__c": 0,
"peer__Requested_Loan_Amount__c": 15300,
"peer__Term__c": 12,
"peer__Time_Left__c": "208 Days -10 Hours -48 Minutes",
"Name": "APP-00041196",
"peer__Borrower__c": "001G000001KY8byIAD",
"peer__Loan__c": "a1WG00000050b8sMAA",
"Id": "a2qG00000009Q9uIAE",
"peer__Percent_Funded__c": 0,
"peer__Monthly_Payment__c": 1338.01
}
]
}