We’ve built Automated Collections with versatility in mind. The following examples provide guidance for customizing your Automated Collections process using Flows and API Triggers. Automated Collections is offered as part of Chargent’s Growth and Enterprise Editions. For more information, see our Pricing Page.
Automated Collections In Flows #
Chargent makes it easy to collect payments anywhere in Salesforce. This is why we have enabled Flow for Automated Collections. We’ve even included an Automated Collections Flow Template to help get you started. Clone that template, then modify it to fit your business needs.
Within the Flow, you can use an Apex Action to trigger Automated Collections using a Global class called ACFlowCreate. Use the InvocableMethod createAutomatedCollections to receive a list of AutomatedCollectionsInput. Below is a description of each attribute:
- AC Process to Trigger: This is used to specify which Automated Collections Process to trigger.
- Record ID List: This is used to define the chargent Order Record IDs to be targeted for the triggering of Automated Collections.
- Post-Collection Payment Status (optional): This is the value applied to the Payment Status field on the related Chargent Order record after this Automated Collections process has collected a payment.
Below are the Output Values:
- Chargent Orders – AC Triggered: This is the list of Chargent Order records for which AC has been triggered.
- Chargent Orders – AC Not Triggered: This is the list of Chargent Order records for which AC could not be triggered.
- DML Status: This is the status of the DML operation.
- Result: This is the result of the operation.
Automated Collections Using an API Trigger #
In the diagram below, you’ll see that Chargent uses the ACWebservice class as an entry point. This class includes the webservice annotation to allow it to be used in the SOAP API.
Note: The ActionService class, getService(), and performAction(String input) methods are global. This means that those methods can be accessed and used in apex code outside the package.
createAutomatedCollections (from ChargentOrders)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:acw="http://soap.sforce.com/schemas/class/ChargentBase/ACWebservice"> <soapenv:Header> <acw:SessionHeader> <acw:sessionId>***************</acw:sessionId> </acw:SessionHeader> </soapenv:Header> <soapenv:Body> <acw:createAutomatedCollections> <!-One or more repetitions:-> <acw:lstRecordObjectIds>lstRecordObjectIds1 </acw:lstRecordObjectIds> <acw:lstRecordObjectIds>lstRecordObjectIds2 </acw:lstRecordObjectIds> <acw:processId>processId</acw:processId> <acw:onCompletePaymentStatus>onCompletePaymentStatus </acw:onCompletePaymentStatus> </acw:createAutomatedCollections> </soapenv:Body> </soapenv:Envelope> |
createAutomatedCollectionsForObject (from any object that has a relationship to ChargentOrder)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:acw="http://soap.sforce.com/schemas/class/ChargentBase/ACWebservice"> <soapenv:Header> <acw:SessionHeader> <acw:sessionId>***************</acw:sessionId> </acw:SessionHeader> </soapenv:Header> <soapenv:Body> <acw:createAutomatedCollectionsForObject> <!-One or more repetitions:-> <acw:lstRecordObjectIds>lstRecordObjectIds1 </acw:lstRecordObjectIds> <acw:lstRecordObjectIds>lstRecordObjectIds2 </acw:lstRecordObjectIds> <acw:processId>processId</acw:processId> <acw:onCompletePaymentStatus>onCompletePaymentStatus </acw:onCompletePaymentStatus> <acw:lookupRelationWithOrders> ChargentBase__Order__c </acw:lookupRelationWithOrders> </acw:createAutomatedCollectionsForObject> </soapenv:Body> </soapenv:Envelope> |
By initiating the Automated Collections process, the following is executed:
- Email with a Payment Request link (if your process includes email) is scheduled
- Payment Request record is created
- Chargent Automated Collection record is created
- Chargent Automated Collection Stage records are created
The “Payment Status” field on the Chargent Order record will be updated to Automated Collections when the process begins.
See Also
Configuring Automated Collections
How to Grow ROI With Accounts Receivable Automation
What is Automated Collections?
Collections Analytics (Reports & Dashboards)