Create an Application (V1)
Description
This web service creates an application and returns the committed record.
This web service only supports creating an application for the Product Type, Loan.
Definition
POST https://<domain>/services/apexrest/genesis/v1/applications/
Parameters
The following table provides details of the request parameters used by this web service:
Field | Type | Description |
---|---|---|
accountId* |
String |
|
contact* |
String |
|
loanAmount* |
Decimal |
|
term* |
Integer |
|
expectedStartDate |
Date |
|
productType* |
String |
|
interestRate* |
Decimal |
|
interestCalcMethod |
String |
|
firstRepaymentDate |
Date |
|
paymentFrequency |
String |
|
interestOnlyPeriod | Integer |
|
balloonPayment | Decimal |
|
Error Messages
When you post a web service, you can receive the possible error messages as shown in the following table:
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 an error occurs while parsing request parameters. |
400 |
INVALID_INPUT |
<exception while parsing the parameters> |
NA |
You will receive this error if there is any exception while parsing the parameters. |
400 |
INVALID_INPUT | Product Type is null | PRODUCT_TYPE_NULL | You will receive this error if the Product Type is not specified in the request parameters. | 400 |
INVALID_INPUT | Unable to find product type. | PRODUCT_TYPE_NOT_FOUND | You will receive this error if the Product Type is invalid in the request parameters. | 400 |
INVALID_INPUT | Both Contact and Account found null. Please provide at least one of them. |
ACCOUNT_CONTACT_ID_NULL | You will receive this error if both accountId and contactId are not specified in the request parameters. | 400 |
INVALID_INPUT | Unable to find the Account. | ACCOUNT_NOT_FOUND | You will receive this error if the account specified in the request parameters is not found. | 400 |
INVALID_INPUT | Unable to find the Contact. | CONTACT_NOT_FOUND | You will receive this error if the contact specified in the request parameters is not found. | 400 |
INVALID_INPUT | Invalid Payment Frequency. | PAYMENT_FREQUENCY_NOT_FOUND | You will receive this error if the payment frequency specified in the request parameters is not valid. | 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 https://na10.salesforce.com/services/apexrest/genesis/v1/applications
{
"accountId": "001F000001NtH4N",
"loanAmount": 1000,
"interestRate": 10,
"term": 12,
"productType": "loan",
"balloonPayment": 100,
"interestOnlyPeriod": 2,
"paymentFrequency": "WEEKLY",
"interestCalcMethod": "Flat",
"daysConvention": "ACTUAL/ACTUAL",
"firstRepaymentDate": "2015-03-15"
}
Sample Response
This sample response contains the newly created application for the given borrower. The sample response is as shown below:
{
"status": "SUCCESS",
"response": [],
"errorMessage": null,
"errorCode": "NO_ERROR",
"content": [
{
"attributes": {
"type": "genesis__Applications__c",
"url": "/services/data/v32.0/sobjects/genesis__Applications__c/a39F00000005yEUIAY"
},
"RecordTypeId": "012F00000012dITIAY",
"genesis__Loan_Amount__c": 1000,
"genesis__Term__c": 12,
"genesis__Interest_Only_Period__c": 2,
"genesis__Product_Type__c": "LOAN",
"genesis__Payment_Frequency__c": "WEEKLY",
"genesis__Expected_First_Payment_Date__c": "2015-03-15",
"genesis__Interest_Calculation_Method__c": "Flat",
"genesis__Landing_Sequence__c": 2,
"genesis__Days_Convention__c": "ACTUAL/ACTUAL",
"genesis__Status__c": "NEW - ENTERED",
"genesis__Expected_Start_Date__c": "2015-02-14",
"Id": "a39F00000005yEUIAY",
"genesis__Expected_Close_Date__c": "2015-03-06",
"genesis__Interest_Rate__c": 10,
"genesis__Balloon_Payment__c": 100,
"genesis__Account__c": "001F000001NtH4NIAV"
}
]
}