Retrieving a Loan Application
Description
This web service retrieves the loan applications. The object type of loan applications is Loan Application (peer__Loan_Application__c).
Definition
https://<domain>/services/apexrest/peer/v1/loanApplications/
Parameters
The table given below provides details of the request parameters used by this web service:
Fields | Type | Description |
---|---|---|
borrowerId | String |
|
status | String |
|
Error message
When you use this web service you can receive the following error message as shown in the table below:
Error Code | Error Message |
System.Label | Reason | HTTP Status Code |
---|---|---|---|---|
INVALID_INPUT |
Account Id is null. |
ACCOUNT_ID_NULL |
You will receive this error if the Account Id (borrowerId) is not specified in the Request Parameters |
400 |
INVALID_INPUT |
Unable to find the Account. |
ACCOUNT_NOT_FOUND |
You will receive this error if no record exists in the system for the Account Id (borrowerId) specified in the Request Parameters |
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/loanApplications?borrowerId=001G000001eGqcV&status=New, In Funding
Sample Response
This sample response contains the loan applications for the given borrower. The sample response that you will receive 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/a2qG00000009OkeIAE" },
"peer__Stage__c":"New",
"peer__Application_Date__c":"2014-06-18",
"peer__Remaining_Requested_Amount__c":500,
"peer__Borrower__r":{
"attributes":{
"type":"Account",
"url":"/services/data/v30.0/sobjects/Account/001G000001eGqcVIAS" },
"Id":"001G000001eGqcVIAS" },
"peer__Amount_Funded__c":0,
"peer__Amount_Time_Left__c":"$5000 / 263 Days -3 Hours -23 Minutes",
"peer__Expiry_Date__c":"2014-09-23T07:11:00.000+0000",
"peer__Interest_Rate__c":9,
"peer__Amount_In_Funding__c":4500,
"peer__Attractiveness_Parameter__c":0,
"peer__Requested_Loan_Amount__c":5000,
"peer__Time_Left__c":"-3 Hours -23 Minutes",
"peer__Term__c":10,
"Name":"APP-00038485",
"peer__Investment_Bookings__r":{
"totalSize":2,
"done":true,
"records":[
{
"attributes":{
"type":"peer__Investment_Booking__c",
"url":"/services/data/v30.0/sobjects/peer__Investment_Booking__c/a2tG00000004niwIAA" },
"peer__Stage__c":"In Funding",
"Name":"IB-00016047",
"peer__Loan_Application__r":{
"attributes":{
"type":"peer__Loan_Application__c",
"url":"/services/data/v30.0/sobjects/peer__Loan_Application__c/a2qG00000009OkeIAE" },
"peer__Borrower__r":{
"attributes":{
"type":"Account",
"url":"/services/data/v30.0/sobjects/Account/001G000001eGqcVIAS" },
"Id":"001G000001eGqcVIAS" },
"peer__Borrower__c":"001G000001eGqcVIAS",
"peer__Expiry_Date__c":"2014-09-23T07:11:00.000+0000",
"Id":"a2qG00000009OkeIAE",
"peer__Percent_Funded__c":90,
"peer__Time_Left__c":"-3 Hours -23 Minutes",
"peer__Term__c":10
},
"peer__Share__c":40,
"CreatedDate":"2014-09-23T09:05:21.000+0000",
"peer__Investment_Amount__c":2000,
"Id":"a2tG00000004niwIAA",
"peer__Booking_Order__r":{
"attributes":{
"type":"peer__Booking_Order__c",
"url":"/services/data/v30.0/sobjects/peer__Booking_Order__c/a2uG00000005gB0IAI" },
"peer__Investor__r":{
"attributes":{
"type":"Account",
"url":"/services/data/v30.0/sobjects/Account/001G000001TcbZMIAZ" },
"Name":"Borrower",
"loan__Undeployed_Funds__c":102476.45,
"loan__Deployed_Funds__c":4500,
"Id":"001G000001TcbZMIAZ",
"loan__Reinvest_Principal__c":false,
"loan__Reinvest_Interest__c":false
},
"peer__Investor__c":"001G000001TcbZMIAZ",
"peer__Funded_Amount__c":4500,
"peer__Amount__c":24300,
"peer__Number_of_Bookings__c":5,
"Id":"a2uG00000005gB0IAI",
"peer__Amount_In_Funding__c":19800
},
"peer__Loan_Application__c":"a2qG00000009OkeIAE",
"peer__Booking_Order__c":"a2uG00000005gB0IAI" },
{
"attributes":{
"type":"peer__Investment_Booking__c",
"url":"/services/data/v30.0/sobjects/peer__Investment_Booking__c/a2tG00000004nirIAA" },
"peer__Stage__c":"In Funding",
"Name":"IB-00016046",
"peer__Loan_Application__r":{
"attributes":{
"type":"peer__Loan_Application__c",
"url":"/services/data/v30.0/sobjects/peer__Loan_Application__c/a2qG00000009OkeIAE" },
"peer__Borrower__r":{
"attributes":{
"type":"Account",
"url":"/services/data/v30.0/sobjects/Account/001G000001eGqcVIAS" },
"Id":"001G000001eGqcVIAS" },
"peer__Borrower__c":"001G000001eGqcVIAS",
"peer__Expiry_Date__c":"2014-09-23T07:11:00.000+0000",
"Id":"a2qG00000009OkeIAE",
"peer__Percent_Funded__c":90,
"peer__Time_Left__c":"-3 Hours -23 Minutes",
"peer__Term__c":10
},
"peer__Share__c":50,
"CreatedDate":"2014-09-23T07:17:55.000+0000",
"peer__Investment_Amount__c":2500,
"Id":"a2tG00000004nirIAA",
"peer__Booking_Order__r":{
"attributes":{
"type":"peer__Booking_Order__c",
"url":"/services/data/v30.0/sobjects/peer__Booking_Order__c/a2uG00000005gB0IAI" },
"peer__Investor__r":{
"attributes":{
"type":"Account",
"url":"/services/data/v30.0/sobjects/Account/001G000001TcbZMIAZ" },
"Name":"Borrower",
"loan__Undeployed_Funds__c":102476.45,
"loan__Deployed_Funds__c":4500,
"Id":"001G000001TcbZMIAZ",
"loan__Reinvest_Principal__c":false,
"loan__Reinvest_Interest__c":false
},
"peer__Investor__c":"001G000001TcbZMIAZ",
"peer__Funded_Amount__c":4500,
"peer__Amount__c":24300,
"peer__Number_of_Bookings__c":5,
"Id":"a2uG00000005gB0IAI",
"peer__Amount_In_Funding__c":19800
},
"peer__Loan_Application__c":"a2qG00000009OkeIAE",
"peer__Booking_Order__c":"a2uG00000005gB0IAI" }
]
},
"peer__Borrower__c":"001G000001eGqcVIAS",
"Id":"a2qG00000009OkeIAE",
"peer__Percent_Funded__c":90,
"peer__Monthly_Payment__c":0
}
]
}