Creating a Loan Disbursal Transaction
Description
This web service creates a Loan Disbursal Transaction(loan__Loan_Disbursal_Transaction__c) on the Loan Account and commits it to the database. It returns the updated Loan Account's information after Loan Disbursal Transaction is created.
Definition
https://<domain>/services/apexrest/peer/v1/loanAccounts/disbursement/*
Parameters
The table given below provides details of the request parameters used by this web service:
Field | Type | Description |
---|---|---|
loanId* |
String |
|
disbursedAmount*1 |
Decimal |
|
disbursementDate |
Date |
|
modeOfPayment* |
String |
Name of the payment mode to be used for disbursal. If the specified payment mode does not exist, an error is returned. If no payment mode is provided, the payment mode defined at the contract level is used, and if that is also not defined, an error is returned. |
reference* |
String |
Text message capturing reference. |
isCleared | Boolean |
|
isReversed | Boolean |
|
isRejected | Boolean |
|
disbursedAmount*1 - This is applicable for loans with Funding in Tranches and Line of Credit.
Error messages
When you use this 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 |
If error occurs while parsing request parameters. |
400 |
INVALID_INPUT |
Unknown Exception : <exception_message> |
UNKNOWN_EXCEPTION |
Unknown exception while parsing request parameters. |
400 |
INVALID_INPUT |
Loan Account Id is null. |
LOAN_ACCOUNT_ID_NULL |
Loan Account Id for Loan is not specified in the request parameters. |
400 |
INVALID_INPUT |
No parameters specified in the JSON body request. |
INVALID_JSON_BODY_IN_POST_REQUEST |
Empty JSON body passed in the HTTP Post Request. |
400 |
INVALID_INPUT |
Unable to find the Loan Account. |
LOAN_ACCOUNT_NOT_FOUND |
No record exists in the system for Loan Id (loanId) specified in the request parameters for a lending account. |
400 |
INVALID_INPUT | Required parameter/s is/are null. | REQUIRED_PARAMETERS_NULL | If any of the required parameter is passed null in the request. | 400 |
INVALID_INPUT | Disbursement Amount can not be a negative value. | NEGATIVE_DISBURSEMENT_AMOUNT | If Disbursement Amount is passed but the value is not greater than 0. | 400 |
INVALID_INPUT | Payment mode is not valid. | PAYMENT_MODE_NOT_VALID | If the Payment Mode name that is passed in the request, does not exist in the system then this exception is thrown. | 400 |
API_EXCEPTION |
<exception_message> |
Not Applicable |
If any validation fails or any unexpected error occurs during the processing of the request, system will raise the exception. |
500 |
Sample request
The sample request to be sent is as shown below:
https://<domain>/services/apexrest/peer/v1/loanAccounts/disbursement/001G000001KY8by
{
"disbursedAmount":10400,
"modeOfPayment" : "cash",
"disbursementDate":"2012-12-22"
}
Where:
loanId: any loanContract as it is also applicable for ‘Fund in Tranches’.
disbursedAmount: String parameter representing a decimal number
modeOfPayment: String parameter like ACH, Cash etc. If the value is not present system, error will be thrown
disbursementDate: String parameter representing date
Sample response
Return response is a Success if the disbursal amount does not add up to the total Loan/Credit limit, Failure otherwise. The disbursal transaction is created, as cleared/uncleared based on ApprovalConfig.
{
"status": "SUCCESS",
"response": [],
"errorMessage": null,
"errorCode": "NO_ERROR",
"content": [ <<List of Disbursal Transaction>> ]
}