Setting up Recurring ACH
Description
This web service sets the Recurring ACH related information on a loan account. If there is an existing Recurring ACH setup, this API will override that and update the setup with the Recurring ACH information provided in the request.
The loan account has to be Active for setting up one-time ACH . Also, there should be no pending ACH transactions for this loan account.
Definition
POST https://<domain>/services/apexrest/peer/v1/loanAccounts/setupRecurringACH /*
Parameters
The table given below provides details of the request parameters used by this web service:
Fields | Type | Description |
---|---|---|
loanId* | String | This is the ID of the loan account. It should be appended to the URL (For more information, see< Sample Request> as given below). |
bankId | String |
|
paymentAmount* | Decimal | This is the ACH Payment Amount. It should be a positive value. |
frequency | String | This is the ACH Frequency. If null, the payment frequency of the loan is defaulted to this field. |
debitDate* | Date | This is the Debit Date for the Next ACH Payment. It should be equal to or after the current system date. |
startDate* | Date | This is the recurring ACH Payments Start Date. |
endDate | Date |
|
accountId | String | This is ID of the borrower account and is a parameter related to SMS verification. |
sms_Token | String | This is the SMS Token to be verified and is a parameter related to SMS verification. |
sms_Unique_Idl | String | This is the unique ID related to SMS token and is a parameter related to SMS verification. |
Error messages
When you post 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 |
INVALID_INPUT | Unable to parse the Request parameters. | UNABLE_PARSE_REQ_PARAMS | System is unable to parse the request body because of an unexpected reason. | 400 |
INVALID_INPUT | Unknown Exception : <exception_message> | UNKNOWN_EXCEPTION | Unknown exception occurs during extracting parameters from the request body. | 400 |
INVALID_INPUT | ACH Debit Date is null | ACH_DEBIT_DATE_NULL | Debit Date for the ACH transaction is not provided in the request. | 400 |
API_EXCEPTION | You cannot setup ACH for a non-active loan. | CANNOT_SETUP_ACH_NON_ACTIVE_LOAN | Loan should be active for setting ACH. | 500 |
API_EXCEPTION | ACH Debit Date should be on or after the current System Date. | ACH_DEBIT_DATE_BACKDT_NOT_ALLOWED | Debit Date passed for request processing is before the current system date. | 500 |
API_EXCEPTION | No record exists for the Bank Account Id. | BANK_ACCOUNT_ID_NOT_EXIST | Bank Account ID provided in the request body does not exist. | 500 |
API_EXCEPTION | Bank Account is not active. | BANK_ACCOUNT_NOT_ACTIVE | Bank Account ID provided in the request body is not active. | 500 |
API_EXCEPTION | The Bank Account does not belong to the loan borrower. | BANK_ACCOUNT_NOT_BELONG_TO_BORROWER | Bank Account ID provided in the request body does not belong to the loan borrower. | 500 |
API_EXCEPTION | Unable to find the Bank Account. | BANK_ACCOUNT_NOT_FOUND | System is unable to find a bank account for setting up ACH. | 500 |
API_EXCEPTION | Unable to find an active Bank Account for the borrower. | BORROWER_ACTIVE_BANK_ACCT_NOT_FOUND | System is unable to find an active bank account for the loan borrower. | 500 |
API_EXCEPTION | ACH Frequency is not valid. | ACH_FREQUENCY_NOT_VALID | The value of frequency provided in the request body is not valid. | 500 |
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/setupRecurringACH/ a1WG0000004QtjcMAC
{ "bankId": "a3EG000000057mL", "paymentAmount": 100, "debitDate": "2014-01-15", "startDate" : "2014-12-20", "frequency" : "Monthly"}
Sample response
The sample response that you will receive is as shown below:
{ "bankId":"a3EG000000057mL", "paymentAmount":100, "debitDate":"2014-01-15", "startDate":"2014-12-20", "frequency":"Monthly"}{ "status":"SUCCESS", "response":[ ], "errorMessage":null, "errorCode":"NO_ERROR", "content":[ { "attributes":{ "type":"loan__Loan_Account__c", "url":"/services/data/v30.0/sobjects/loan__Loan_Account__c/a1WG0000004QtjcMAC" }, "loan__Ach_Debit_Day__c":15, "loan__Borrower_ACH__c":"a3EG000000057mLMAQ", "loan__Frequency_of_Loan_Payment__c":"Monthly", "loan__Loan_Status__c":"Active - Good Standing", "loan__ACH_End_Date__c":"2015-05-11", "loan__ACH_Debit_Amount__c":100, "loan__ACH_Next_Debit_Date__c":"2014-01-15", "loan__ACH_Frequency__c":"Monthly", "loan__Contact__c":"003G000001NT2xVIAT", "loan__ACH_On__c":true, "Id":"a1WG0000004QtjcMAC", "loan__Account__c":"001G000001ZO1hsIAD", "loan__ACH_Start_Date__c":"2014-12-20", "loan__Maturity_Date_Current__c":"2015-05-11" } ] }