Creating a payoff quote for a loan account
Description
This web service creates a payoff quote for a loan account as on the input payoff date and attaches it to the loan account. Along with the payoff amount as of the transaction date, it also breaks up the payoff amount into unpaid principal, interest, and charges if any are applicable.
Definition
https://<domain>/services/apexrest/peer/v1/loanAccounts/payoff/id
Parameters
The table given below provides details of the request parameters used by this web service:
Field |
Type | Description |
---|---|---|
loanId* |
String |
|
transactionDate |
Date | This is the creation date for pay off object. If null, then the current system date is considered. |
payOffDate |
Date | This is the date for which pay off quote has to be generated. If null, then the current system date is considered for calculating the payoff amount. |
payoffQuoteName | String | This is the name of the payoff quote. |
applyFuturePayments | Boolean | This indicates whether future payments will be paid on time or not. |
generateQuoteForEntireFacility | Boolean | This indicates whether the payoff quote is to be generated for the entire Master Facility or not. |
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 |
Loan Account Id is null |
LOAN_ACCOUNT_ID_NULL |
Loan Account ID (loanId) is not specified in the request URL |
400 |
INVALID_INPUT |
Unable to find the Loan Account |
LOAN_ACCOUNT_NOT_FOUND |
No record exists in the system for the Loan Account ID (loanId) specified in the request URL |
400 |
API_EXCEPTION |
Unable to generate the Payoff Quote. |
PAYOFF_QUOTE_NOT_GENERATED |
System is unable to generate a Payoff Quote because of an unknown reason |
500 |
API_EXCEPTION |
<exception_message> |
NA |
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/loanAccounts/payoff/LAI-00000426
{
"transactionDate": "2017-01-18",
"payOffDate": "2017-05-18",
"payoffQuoteName": "sample",
"applyFuturePayments": true,
"generateQuoteForEntireFacility": true
}
Sample response
This sample response contains the payments between the specified dates for the given loan account. The sample response is as shown below:
{
"status": "SUCCESS",
"response": [],
"errorMessage": null,
"errorCode": "NO_ERROR",
"content": [
{
"attributes": {
"type": "loan__Payoff_Quote__c",
"url": "/services/data/v30.0/sobjects/loan__Payoff_Quote__c/a2BG0000000Ivi9MAC"
},
"loan__Poq_Interest_Per_Diem__c": 0.99,
"loan__Poq_Interest_Rate__c": 9.1,
"loan__Poq_Unpaid_Interest__c": 355.52,
"loan__Poq_valid_till_Dt__c": "2014-12-18",
"loan__Poq_Excess_Amount_Paid__c": 0,
"loan__Poq_Trust_Balance__c": 0,
"loan__Poq_Next_Payment_Due_Dt__c": "2014-01-17",
"loan__Poq_Principal_Bal__c": 3917.71,
"loan__Poq_Total_Payoff_Amount__c": 4273.23,
"loan__Poq_Accrued_Late_Charges__c": 0,
"loan__Poq_Accrued_Interest__c": 0,
"loan__Poq_Maturity_Date__c": "2014-12-17",
"loan__Poq_Interest_Paid_Till_Dt__c": 3.27,
"loan__Poq_Other_Fees__c": 0,
"Id": "a2BG0000000Ivi9MAC",
"loan__Poq_Unpaid_Late_Charges__c": 0,
"loan__Poq_Prepayment_Penalty__c": 0,
"loan__Poq_Unpaid_Charges__c": 0,
"loan__Loan_Account__c": "a1WG0000000jR7nMAE",
"loan__Poq_Transaction_Date__c": "2014-12-18"
}
]
}