# Chase unpaid invoices

URL: /workflows/guides/chase-unpaid-invoices · Id: `guide:chase-unpaid-invoices`

> Say "chase unpaid invoices" and every late Invoice gets three reminders, then a Task to you at 30 days.

Every late [Invoice](/business/nouns/invoice) gets a reminder at 3, 7 and 14 days with its pay link, and comes to you at 30. Most late invoices are forgotten, not disputed; a polite email collects them.

Needs: [Send an invoice](/systems/finance/send-an-invoice)

**Before it runs**

- You leave the chat: Never: it all happens in the chat.

## What you get
- 3 reminder emails per late Invoice, at 3, 7 and 14 days past due, each with its pay link (Message)
- 1 Task to you for any Invoice still unpaid at 30 days (Task)
- 1 service pause for that Customer until it pays (Subscription)
- 1 line in your books when each one is paid (Entry)

## Your agent does
**For agents**

- Guide: `guide:chase-unpaid-invoices`, status `live`. Page: [/workflows/guides/chase-unpaid-invoices.md](/workflows/guides/chase-unpaid-invoices.md).
- Approval: none. Run it when the founder asks.
- Leaves the chat: never.
- Needs first: [Send an invoice](/systems/finance/send-an-invoice).
- Run: call the steps in order, each through the API, SDK, CLI or MCP tab below; a later step passes the `$id` an earlier one returns. Each value marked example is the sample business’s: pass the founder’s own.

| Step | Verb | Inputs (type, required, this guide’s value) | Returns |
| --- | --- | --- | --- |
| 1 | [`Process.enable`](/business/nouns/process/enable) (`verb:Process.enable`) | `process` Process (an id), required: example `"process_billing"` | `process` Process |
| 2 | [`Setting.update`](/business/nouns/setting/update) (`verb:Setting.update`) | `id` string, required: example `"setting_1"`; `key` string: example `"dunning.pauseService"`; `value` json: example `true` | `setting` Setting |

Returns: the last call answers with `setting` and its `action`, whose `status` is `done`, `pending` (waiting on an Approval or a Worker), `failed`, `canceled` or `refused`:

```json
{
  "api": "https://api.sb/leaseline.app",
  "setting": {
    "$id": "https://api.sb/leaseline.app/settings/setting_1",
    "$type": "Setting",
    "key": "dunning.pauseService",
    "value": true
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/action_1",
    "operation": "Setting.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/action_1"
  }
}
```

Next: offer “Never remind Riverside Property; I call them myself”, or “Hand anything over $5,000 to me at 14 days”.

Calls: `Process.enable` → `Setting.update`

Ask:

```text
Chase unpaid invoices.
Remind customers who have not paid.
Follow up on overdue invoices.
```

API:

```bash
# 1. Process.enable
curl -X POST https://api.sb/leaseline.app/processes/process_billing/enable \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"

# 2. Setting.update
curl -X PATCH https://api.sb/leaseline.app/settings/setting_1 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":true,"key":"dunning.pauseService"}'
```

SDK:

```ts
import { $ } from 'startup-builder'

await $.Process.enable({ process: 'process_billing' })
await $.Setting.update({ id: 'setting_1', value: true, key: 'dunning.pauseService' })
```

CLI:

```bash
npx startup-builder do Process.enable --json '{"process":"process_billing"}'
npx startup-builder do Setting.update --json '{"id":"setting_1","value":true,"key":"dunning.pauseService"}'
```

MCP:

```json
{
  "name": "do",
  "arguments": {
    "code": "await $.Process.enable({ process: 'process_billing' })\nreturn await $.Setting.update({ id: 'setting_1', value: true, key: 'dunning.pauseService' })"
  }
}
```

## Change it
- Never remind Riverside Property; I call them myself.
- Hand anything over $5,000 to me at 14 days.
- Write off anything under $20 after 90 days.

## Under the hood
- Systems: [Billing](/systems/billing), [Ledger](/systems/ledger), [Mailboxes](/systems/mailboxes)
- Nouns: [Invoice](/business/nouns/invoice), [Process](/business/nouns/process), [Setting](/business/nouns/setting), [Message](/business/nouns/message), [Task](/business/nouns/task)
- Events: `Invoice.overdue`, [`Invoice.collected`](/business/events/Invoice.collected)
- Stripe objects: `Invoice`, `Subscription`

The [Billing](/workflows/processes/billing) [Process](/business/nouns/process) sends the reminders daily. A failed [Card](/business/nouns/card) payment is a different problem, with [its own guide](/systems/finance/retry-failed-payments).