Retrieving Investment Orders
Description
This web service returns all the investment orders that belong to an investor, along with the Investor Payments (Investor Loan Transactions).
Definition
GET https://<domain>/services/apexrest/peer/v1/investmentOrders
Parameters
The table given below provides details of the request parameters used by this web service:
Fields | Type | Description |
---|---|---|
investorId * | String |
|
status | String |
|
loanStatus | 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 | Investor ID is null | INVESTOR_ID_NULL | You will receive this error if the Account ID for investor (investorId) is not specified in the request parameters | 400 |
INVALID_INPUT | Unable to find the Investor Account | INVESTOR_ACCOUNT_NOT_FOUND | You will receive this error if no record exists in the system for Account Id (investorId) specified in the request parameters for investor | 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:
GET https://na11.salesforce.com/services/apexrest/peer/v1/investmentOrders?investorId=001G000001Phdoe&status=Active&loanStatus=Active - Good Standing
Sample response
The sample response that you will receive is as shown below:
{ "status": "SUCCESS", "response": [ { "systemDate": "2014-07-25" } ], "errorMessage": null, "errorCode": "NO_ERROR", "content": [ { "attributes": { "type": "loan__Investor_Loan__c", "url": "/services/data/v30.0/sobjects/loan__Investor_Loan__c/a1JG0000008VZaSMAW" }, "loan__Total_Amount_Paid__c": 0, "loan__Interest_Disbursed_To_Investor__c": 0, "loan__Inv_Last_Interest_Accrual_Post_Date__c": "2013-12-21", "loan__Interest_Balance__c": 0, "loan__Inv_Interest_Posted_Amt__c": 0, "loan__Investor_Loan_Txns__r": { "totalSize": 1, "done": true, "records": [ { "attributes": { "type": "loan__Investor_Loan_Account_Txns__c", "url": "/services/data/v30.0/sobjects/loan__Investor_Loan_Account_Txns__c/a1IG000001T6FPKMA3" }, "loan__Late_Fee_Service_Charge__c": 0, "loan__Investor_Loan__c": "a1JG0000008VZaSMAW", "loan__Txn_Code__c": "PAYMENT APPROVAL", "loan__Post_Date__c": "2013-12-21", "loan__Txn_Description__c": "Investment Activated", "loan__Interest_Service_Charge__c": 0, "loan__Transaction_Date__c": "2013-12-21", "Name": "ILTID-0000011451", "loan__Late_Fees_Paid__c": 0, "loan__Txn_Amount__c": 10000, "loan__Interest_Paid__c": 10, "loan__Investor_Loan__r": { "attributes": { "type": "loan__Investor_Loan__c", "url": "/services/data/v30.0/sobjects/loan__Investor_Loan__c/a1JG0000008VZaSMAW" }, "Id": "a1JG0000008VZaSMAW", "loan__Loan__r": { "attributes": { "type": "loan__Loan_Account__c", "url": "/services/data/v30.0/sobjects/loan__Loan_Account__c/a1WG0000000jskCMAQ" }, "Name": "LAI-00003516", "Id": "a1WG0000000jskCMAQ", "loan__Account__c": "001G000001KY8byIAD", "loan__Account__r": { "attributes": { "type": "Account", "url": "/services/data/v30.0/sobjects/Account/001G000001KY8byIAD" }, "peer__Nickname__c": "Shivam", "Id": "001G000001KY8byIAD" } }, "loan__Loan__c": "a1WG0000000jskCMAQ" }, "loan__Principal_Paid__c": 11, "Id": "a1IG000001T6FPKMA3" } ] }, "loan__Certificate_Rate__c": 9, "loan__Loan__c": "a1WG0000000jskCMAQ", "Name": "ILID-0000011733", "loan__Principal_Amount_Paid__c": 0, "loan__Inv_Accrued_Interest_Amt__c": 0, "loan__Service_Rate__c": 2, "loan__Remaining_Investment_Amount__c": 10000, "Id": "a1JG0000008VZaSMAW", "loan__Interest_Reinvested__c": 0, "loan__Account__c": "001G000001PhdoeIAB", "loan__Loan__r": { "attributes": { "type": "loan__Loan_Account__c", "url": "/services/data/v30.0/sobjects/loan__Loan_Account__c/a1WG0000000jskCMAQ" }, "loan__Loan_Status__c": "Active - Good Standing", "Name": "LAI-00003516", "loan__Next_Installment_Date__c": "2014-01-21", "loan__Last_Transaction_Timestamp__c": "2013-12-21T16:44:59.000+0000", "Id": "a1WG0000000jskCMAQ", "loan__Number_of_Installments__c": 12, "loan__Account__c": "001G000001KY8byIAD", "loan__Account__r": { "attributes": { "type": "Account", "url": "/services/data/v30.0/sobjects/Account/001G000001KY8byIAD" }, "peer__Nickname__c": "Shivam", "Id": "001G000001KY8byIAD" }, "loan__Maturity_Date_Current__c": "2014-12-21" }, "loan__Investment_Amount__c": 10000, "loan__Interest_Amount_Paid__c": 0, "loan__Enabled_Flag__c": true } ] }