Creating a loan payment transactions
Description
This web service posts a payment transaction for a loan.
Definition
POST https://<domain>/services/apexrest/peer/v1/loanAccounts/payments/*
Parameters
The table given below provides details of the request parameters used by this web service:
Field | Type | Description |
---|---|---|
loanId* | String |
|
amount* | Decimal | This is the payment amount that you wish to post . |
date | Date | This is the transaction date for the loan payment. If null, then the current system date is considered. |
paymentMode | String | This is the payment mode for the loan payment. If null, then ACH is considered. |
accountId | String | This is ID of the borrower account and is a parameter related to SMS verification. It is ignored, if SMS verification is disabled. |
sms_Token | String | This is the SMS Token to be verified and is a parameter related to SMS verification. It is ignored, if SMS verification is disabled. |
sms_Unique_Id | String | This is the unique ID related to SMS token and is a parameter related to SMS verification. It is ignored, if SMS verification is disabled. |
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 | System is unable to parse the request body. Possible reasons could be JSON is not valid/properly formatted. | 400 |
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 |
INVALID_INPUT | Unknown Exception : <exception_message> | UNKNOWN_EXCEPTION | Unknown exception while parsing request parameters. | 400 |
INVALID_INPUT | Loan Payment Transaction Amount is null. | LOAN_PAYMENT_TXN_AMT_NULL | Loan payment amount is not specified. | 400 |
INVALID_INPUT | Loan Payment Transaction Date is null. | LOAN_PAYMENT_TXN_DATE_NULL | Transaction date for loan payment is null and system is not able to get current system date. | 400 |
INVALID_INPUT | Payment mode is not valid. | PAYMENT_MODE_NOT_VALID | The provided payment mode is not valid. | 400 |
API_EXCEPTION | <exception_message> | NA | 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://na11.salesforce.com/services/apexrest/peer/v1/loanAccounts/payments/LAI-00000426
{ "amount" : 100 , "date" : "2016-01-10", "paymentMode": "Cash"}
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__Loan_Payment_Transaction__c", "url":"/services/data/v30.0/sobjects/loan__Loan_Payment_Transaction__c/a1dG00000003Uv3IAE" }, "loan__Transaction_Date__c":"2013-12-19", "loan__Transaction_Amount__c":100, "Id":"a1dG00000003Uv3IAE", "loan__Payment_Mode__c":"a2AG00000002bpKMAQ", "loan__Receipt_Date__c":"2013-12-19", "loan__Loan_Account__c":"a1WG0000000jR7nMAE" } ] }