> ## Documentation Index
> Fetch the complete documentation index at: https://alguna.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Collections

> How Alguna tracks overdue invoices and runs reminder workflows

Collections is the workflow Alguna runs once an invoice's due date has passed without payment. It covers the status transition from issued to overdue, the reminder cadence sent to the customer, and the visibility your finance team needs to see what's outstanding.

If you're looking for failed-payment recovery on issued invoices that haven't yet hit their due date, see [Dunning](/docs/collections/dunning).

***

## How It Works

```mermaid theme={null}
graph LR
    A[Issued invoice] --> B{Due date passed?}
    B -->|No| A
    B -->|Yes| C[Status -> Overdue]
    C --> D[InvoiceStatusUpdated event]
    D --> E[Overdue Invoice Reminder template]
    E --> F[Wait, re-check, send reminder]
    F --> G{Still overdue?}
    G -->|Yes| H[Send next reminder]
    G -->|No| I[Run ends]
```

A scheduled job runs across every organization and looks at any invoice in the `Issued` status whose due date has passed. Those invoices are transitioned to `Overdue`. The transition emits an `InvoiceStatusUpdated` event, which any matching automation can pick up.

***

## The Default Template

Every organization starts with a built-in template called **Overdue Invoice Reminder**. It sends a configurable number of reminders with delays between each, and re-checks the invoice's status before each send so paid invoices don't continue to receive reminders.

| Property         | Value                                                    |
| ---------------- | -------------------------------------------------------- |
| Trigger          | `Invoice Status Updated` event                           |
| Condition        | `status == 'overdue'`                                    |
| Execution policy | Always (each transition into overdue starts a fresh run) |
| Default cadence  | First reminder at +3 days, second reminder at +6 days    |

Each reminder step is preceded by a status check. If the invoice is no longer overdue at the moment the check runs, the reminder is skipped and the run ends.

***

## Invoice Status Transitions

Collections operates at the boundary between three invoice statuses:

| From    | To      | Triggered by                                |
| ------- | ------- | ------------------------------------------- |
| Issued  | Overdue | Scheduled job, when the due date has passed |
| Overdue | Paid    | Payment received                            |
| Overdue | Void    | Manual void by your team                    |

Overdue is also a syncable status — if you have an accounting integration enabled (Xero, QuickBooks, NetSuite), the overdue state propagates to the connected ledger.

***

## Configuration

Collections is configured in two places:

### Payment terms (drives when invoices go overdue)

Payment terms are set per customer or as a default on the **Invoices** settings page. The number of days from issue date to due date determines when the overdue cron flips the invoice. See [Invoicing Configuration](/docs/invoices/invoicing-config) for setup.

### Reminder cadence (drives when emails are sent)

Reminder cadence is configured by editing the **Overdue Invoice Reminder** automation:

1. Open **Automations**.
2. Either enable the built-in template or **Clone** it to create an editable copy.
3. Adjust the wait durations and add or remove reminder steps.
4. Optionally change the email template used by each `Send invoice reminder` step under **Settings → Emails**.
5. Activate the automation.

You are not limited to two reminders. Add more `Wait → Get invoice → Condition → Send reminder` blocks to extend the cadence.

***

## Visibility

The dashboard surfaces overdue invoices in two places:

**A/R Aging widget on the Overview page.** Outstanding receivables are bucketed by age (0–30 days, 30–60 days, 60+ days) so you can see how concentrated your overdue exposure is.

**Invoices list, filtered by status.** Filter to `Overdue` to see every outstanding invoice, sorted by days past due.

***

## What the System Does Automatically

* Transitions issued invoices to overdue when the due date passes, on a recurring schedule.
* Re-checks invoice status before every reminder send and skips the send if the invoice is no longer overdue.
* Deduplicates reminder runs per invoice — a single transition into overdue starts a single run.
* Stops sending further reminders the moment an invoice is paid or voided, even mid-run.
* Syncs the overdue status to connected accounting integrations.

## What the System Does Not Do Automatically

* Send reminders before the due date. Pre-due reminders are a separate feature; see the **Invoice Due Reminder** automation template.
* Charge the customer. Collections is a notification flow; charging is handled by [Dunning](/docs/collections/dunning) on payment failures or by autocharge on subscriptions.
* Apply late fees. Late fees are not part of the default flow.

***

## Edge Cases

**Invoice paid between reminders.** The status check before each reminder step catches this; the run ends without sending the next reminder.

**Invoice voided while overdue.** Same as above — the status check sees the invoice is no longer overdue and stops the run.

**Manually-issued invoice without a due date.** The overdue cron only flips invoices that have a due date. Invoices issued without one stay in the `Issued` status indefinitely.

**Partial payment received.** Partial payments do not change the invoice status; the invoice stays overdue until fully paid. Reminders continue.

**Multiple invoices for the same customer.** Each invoice runs its own independent reminder workflow.

**Subscription cancelled while invoice is overdue.** The reminder workflow continues against the outstanding invoice. To halt collections on cancellation, add a condition step checking subscription status.

***

## Example

A \$1,800 invoice with `Net 30` payment terms is issued on April 1. Payment terms make it due on May 1.

| Date         | What Happens                                              |
| ------------ | --------------------------------------------------------- |
| April 1      | Invoice issued, status `Issued`                           |
| May 1        | Due date passes                                           |
| May 2 (cron) | Status flips to `Overdue`, `InvoiceStatusUpdated` emitted |
| May 2        | **Overdue Invoice Reminder** triggers, waits 3 days       |
| May 5        | Status check: still overdue. First reminder sent.         |
| May 5        | Wait 3 days                                               |
| May 8        | Status check: still overdue. Second reminder sent.        |
| May 8        | Run ends                                                  |

If the customer had paid on May 6, the second status check on May 8 would have seen the invoice as `Paid`, the reminder would have been skipped, and the run would have ended.

***

## Impact on Other Parts of Alguna

* **Accounting integrations**: overdue is a synced status, so your connected ledger reflects it.
* **Revenue reporting**: overdue invoices are still recognized revenue (collections affects cash, not recognition). See [Revenue Recognition](/docs/revenue/recognition).
* **Dunning**: collections runs after the due date; dunning runs on payment failures and can trigger before the due date if autocharge fails. The two flows are independent and can both run on the same invoice.
* **Customer portal**: the [hosted customer portal](/docs/hosted/customer-portal) shows the overdue status to the customer alongside a payment link.

***

## FAQ

**Can I send more than two reminders?**
Yes. Clone the **Overdue Invoice Reminder** template and add more reminder steps. There is no upper limit.

**Can I attach a payment link to the reminder email?**
Yes. The default reminder email template includes a hosted payment link. The link routes to the [hosted customer portal](/docs/hosted/customer-portal) where the customer can pay.

**What stops the reminders?**
Any of: invoice paid, invoice voided, the run reaches the end of its configured steps, or you manually cancel the run from the automation execution view.

**Does an overdue invoice affect recognized revenue?**
No. Overdue is a payment/collection state, not a recognition state. Revenue is recognized based on your recognition rules; see [Revenue Recognition](/docs/revenue/recognition).

**Does collections trigger dunning, or vice versa?**
They run independently. Dunning fires on `PaymentFailed`; collections fires on the `Issued → Overdue` status transition. The same invoice can be subject to both flows.

**Can I customize the email copy?**
Yes, under **Settings → Emails**. You can edit the templates used by `EmailTypeInvoiceReminderOverdue` and `EmailTypeInvoiceReminderDue`.
