Create automated payment setup for One Time ACH or Recurring ACH on a loan account
Description
This web service allows the client of this API to create Auto Payment Setup records in the system. It validates the input request, commits the changes in the database and returns the created record. This API also supports previously written ACH Setup APIs for One Time and Recurring ACH.
In case of one time ACH setups, the parameter 'manualSpreadName' allows you to define the manual spread to be applied to the payment.
Definition
POST https://<domain>/services/apexrest/peer/v2/loanAccounts/setupACH/*
Parameters
Field | Type | Description |
---|---|---|
loanId* | String |
|
bankAccountId | String |
|
transactionAmount | Decimal |
|
feeAmount | Decimal |
|
paymentModeName | String |
|
frequency | String |
|
amountType | String |
|
type | String |
|
debitDate | Date |
|
recurringACHStartDate | Date |
|
recurringACHEndDate | Date |
|
setupDate | Date |
|
manualSpreadName | 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 | Unable to parse the request parameters. | UNABLE_PARSE_REQ_PARAMS | If error occurs while parsing request parameters. | 400 |
INVALID_INPUT | ACH Debit Date is null. | ACH_DEBIT_DATE_NULL | If error occurs while parsing request parameters. | 400 |
INVALID_INPUT | Payment Mode Name is required. | NA | If error occurs while parsing request parameters. | 400 |
INVALID_INPUT | Amount Type is required. | NA | 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 | 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 Loan Account. | 400 |
INVALID_INPUT | Either Lock Based ACH or Multiple Payment Method Support must be enabled to use this feature. | NA | If either of Lock Based ACH or Multiple Payment Method Support is not enabled in Org wide Custom Settings then system will raise this exception. | 400 |
INVALID_INPUT | Invalid ACH Type. ACH must be ONE TIME or RECURRING. | NA | If ACH Type is not given in the request parameters then system will raise this exception. | 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/v2/loanAccounts/setupACH/a2737000000IgCj
Sample request
{
"transactionAmount" : 100,
"debitDate" : "2013-12-19",
"paymentModeName": "Credit Card",
"frequency": "Weekly",b
"amountType": "FIXED AMOUNT",
"type": "One Time"
}
Sample response
The sample response is as shown below that contains the updated loan application:
{
"status": "SUCCESS",
"rowNumber": -1,
"response": [],
"errorNumber": 0,
"errorMessage": "",
"errorCode": "",
"content": [
{
"attributes": {
"type": "loan__Automated_Payment_Setup__c",
"url": "/services/data/v34.0/sobjects/loan__Automated_Payment_Setup__c/a4p37000000GnVDAA0"
},
"loan__CL_Contract__c": "a2737000000IgCjAAK",
"loan__Active__c": true,
"loan__Type__c": "One Time",
"loan__Bank_Account__c": "a0j37000000hg8eAAA",
"loan__Frequency__c": null,
"loan__Payment_Mode__c": "a2m3700000002cKAAQ",
"loan__Amount_Type__c": "FIXED AMOUNT",
"loan__Transaction_Amount__c": 100,
"loan__Debit_Date__c": "2013-12-19",
"loan__Recurring_ACH_Start_Date__c": null,
"loan__Recurring_ACH_End_Date__c": null,
"loan__Setup_Date__c": "2013-12-19",
"Id": "a4p37000000GnVDAA0"
}
]
}