Creating Investment Bookings
Description
This web service creates all the investment bookings that belong to an investor for a given loan application.
Definition
POST https://<domain>/services/apexrest/peer/v1/investmentBookings
Parameters
The table given below provides details of the request parameters used by this web service:
Fields | Type | Description |
---|---|---|
investorId * |
String |
|
bookingOrderId | String |
|
loanApplication | String |
|
investmentAmount | Decimal |
|
certificateRate | Decimal |
|
serviceRate | Decimal |
|
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 parse the request parameters | UNABLE_PARSE_REQ_PARAMS | You will receive this error while parsing request parameters. | 400 |
INVALID_INPUT | The Loan Application is null | Null Loan Application | You will receive this error if the Loan Application 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:
POST
{ "investorId":"001G000001VMLHF", "investmentAmount":1500, "loanApplication":"a2qG00000009djW"}
Sample Response
The sample response that you will receive is as shown below:
{ "status":"SUCCESS", "response":[ ], "errorMessage":null, "errorCode":"NO_ERROR", "content":[ { "attributes":{ "type":"peer__Investment_Booking__c", "url":"/services/data/v30.0/sobjects/peer__Investment_Booking__c/a2tG000000050RiIAI" }, "peer__Stage__c":"In Funding", "peer__Certificate_Rate__c":9, "peer__Service_Rate__c":0, "peer__Investment_Amount__c":null, "Id":"a2tG000000050RiIAI", "peer__Loan_Application__c":"a2qG00000009djWIAQ", "peer__Booking_Order__c":"a2uG00000005xaeIAA" } ] }