Setting up one time ACH
Description
This web service sets the one time ACH related information on a loan account. There should not be any pending ACH transactions for the loan account. If an existing one time ACH setup is present, this web service will override this set up and update it with the one time ACH information provided in the request.
The loan account has to be Active for setting up one time ACH.
Definition
POST https://<domain>/services/apexrest/peer/v1/loanAccounts/setupOneTimeACH/*
Parameters
The table given below provides details of the request parameters used by this web service:
Field | 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> given below). |
bankId | String |
|
paymentAmount* | Decimal | This is the ACH Payment Amount. It should be a positive value. |
feeAmount | Decimal | This is the ACH Fee Amount, if any |
debitDate* | Date | This is the ACH Debit Date. It should be equal to or after the current system date. |
accountId | String |
|
sms_Token | String |
|
sms_Unique_Id | String |
|
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 | The system is unable to parse the request body due to an unexpected reason. | 400 |
INVALID_INPUT | Unknown Exception : <exception_message> | UNKNOWN_EXCEPTION | Unknown exception occurs while 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 up 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 | <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/setupOneTimeACH/a1WG0000004QtjcMAC
{ "bankId":"a3EG000000057mL", "paymentAmount":100 , "debitDate":"2014-01-15"}
Sample response
The sample response is as shown below:
{ "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__Loan_Status__c":"Active - Good Standing", "loan__OT_ACH_Debit_Date__c":"2014-01-15", "loan__OT_ACH_Payment_Amount__c":100, "loan__OT_ACH_Fee_Amount__c":null, "loan__OT_Borrower_ACH__c":"a3EG000000057mLMAQ", "loan__Contact__c":"003G000001NT2xVIAT", "Id":"a1WG0000004QtjcMAC", "loan__Account__c":"001G000001ZO1hsIAD" } ] }