How to use one of the external APIs for collecting debts for unpaid invoices.
Based on the configuration, a debt collection task for unpaid invoice is created and sent to external debt collection API. The debt collection task checks the status continuously for invoices that are sent to debt collection. If an invoice is paid in the Atomia system in meantime, or if deadline for debt collection has passed, a debt collection cancel command is sent to the external API.
Once the debt is collected, a debt collection payment is created in the Atomia system and the invoice is closed. If the invoice was previously credited, a copy of that invoice will be created and closed with newly created payment.
Before you begin
The Atomia platform supports configuration and detection of unpaid invoices, gathering data and creating requests for debt collection to external APIs. One of the external APIs must be used for debt collection itself.
Configuring an invoice reminder
To start sending invoices to debt collection, the Atomia system must be configured. Both the time an invoice is to be sent to debt collection and what external API for debt collection to use needs to be defined.
- Go to Admin panel > Settings > Plugin configuration > Generic Workflow > Scheduled Tasks: Invoice Reminder configuration.
- Add a new Action handler, either for existing or new reminder.
- Configure the Action handler as follows:
- Class name: Atomia.Billing.Plugins.GenericWorkflowPlugin.CustomActions.InvoiceDebtCollectionCustomAction, Atomia.Billing.Plugins.GenericWorkflowPlugin
- DebtCollectionPlugin: Name of the plugin used for debt collection.
- CreditInvoice: True or false, defines if invoice is credited when it’s sent to debt collection or not.
- DaysLimit: Positive integer number, defines after how many days debt collection is canceled. Use 0 for never.
Configuring invoice debt collection
- Go to Admin panel > Settings > Plugin configuration > Generic Workflow > Scheduled Tasks: Invoice Debt Collection configuration.
- Several parameters can be changed:
- Auto approve tasks: Defines if debt collection tasks are approved automatically.
- Timeout between status check: Period in minutes between the payment checks. Used if debt is collected with external debt collection API.
- Approved items count: Number of processed items on each task execution.
Executing scheduled debt collection tasks
- Go to Admin panel > Settings > Scheduled task settings.
- Make sure that InvoiceDebtCollectionScheduledEventHandler task is scheduled to execute regularly.