# Payables

URL: /workflows/processes/payables · Id: `process:payables`

> Payables matches each Bill to its Agreement, gets it approved within a Mandate, pays it on its due date, and reconciles the payment.

Payables matches each [Bill](/business/nouns/bill) to its [Agreement](/business/nouns/agreement), gets it approved within a [Mandate](/business/nouns/mandate), pays it on its due date, and reconciles the payment.

## Outcome
| Part | This Process |
| --- | --- |
| Outcome | Each Bill matches an Agreement, is approved within a Mandate, is paid on its due date and is reconciled to the ledger. |
| Reads | [Bill](/business/nouns/bill), [Agreement](/business/nouns/agreement) |
| Leaves | [Transaction](/business/nouns/transaction), [Entry](/business/nouns/entry), [Bill](/business/nouns/bill) |
| Runs in | Each Startup |

## Accountable
[Finance Lead](/agents/finance/finance-lead), [Finance Team](/agents/finance).

Responsible: [Treasurer](/agents/finance/treasurer).

Consulted: [Operations Lead](/agents/operations/operations-lead).

Informed: [Founder](/agents/founding/founder).

## Workflows
| Workflow | Runs | Team |
| --- | --- | --- |
| [Pay bills](/workflows/processes/payables/pay-bills) | on `Bill.created` | [Finance Team](/agents/finance) |

## Who does each step

| Workflow | Step | Role | Calls | Approval |
| --- | --- | --- | --- | --- |
| [Pay bills](/workflows/processes/payables/pay-bills) | 1. Match the Bill to its vendor’s Agreement and code it. | [Finance Lead](/agents/finance/finance-lead) | [Bill.update](/business/nouns/bill/update) | None |
| [Pay bills](/workflows/processes/payables/pay-bills) | 2. Approve the Bill within the Finance Lead’s Mandate, or ask the Founder above it. | [Finance Lead](/agents/finance/finance-lead) | [Bill.approve](/business/nouns/bill/approve) | Asks first; waits 1 business hour |
| [Pay bills](/workflows/processes/payables/pay-bills) | 3. Pay the Bill before its due date. | [Treasurer](/agents/finance/treasurer) | [Bill.pay](/business/nouns/bill/pay) | Asks first; waits 1 business hour |
| [Pay bills](/workflows/processes/payables/pay-bills) | 4. Reconcile the payment to the ledger. | [Treasurer](/agents/finance/treasurer) | [Transaction.reconcile](/business/nouns/transaction/reconcile) | None |

## Events
| Direction | When | What happens |
| --- | --- | --- |
| In | On `Bill.created` | Starts [Pay bills](/workflows/processes/payables/pay-bills) |
| In | On `Bill.created` | Wakes this Process, the first time only. The first Bill arrives. |
| Out | `Bill.updated` | Raised by step 1 of [Pay bills](/workflows/processes/payables/pay-bills) |
| Out | [`Bill.approved`](/business/events/Bill.approved) | Raised by step 2 of [Pay bills](/workflows/processes/payables/pay-bills) |
| Out | [`Bill.paid`](/business/events/Bill.paid) | Raised by step 3 of [Pay bills](/workflows/processes/payables/pay-bills) |
| Out | [`Transaction.reconciled`](/business/events/Transaction.reconciled) | Raised by step 4 of [Pay bills](/workflows/processes/payables/pay-bills) |

## Plays
No Play names this Process.

## Controls
No Control names this Process or a Workflow of it.

## Settings
| Setting | Type | Default | Say | Set with |
| --- | --- | --- | --- | --- |
| `bills.approveBelow` | `money` | $1,000 | Approve bills under $1,000 without asking me | [Setting.update](/business/nouns/setting/update) |
| `bills.payBeforeDays` | `integer` | `2` | Pay bills two days before they are due | [Setting.update](/business/nouns/setting/update) |

## Failure
A failed step retries; when retries run out, the Action goes to the [Finance Lead](/agents/finance/finance-lead).

| Step | On failure |
| --- | --- |
| [Pay bills](/workflows/processes/payables/pay-bills) 1. Match the Bill to its vendor’s Agreement and code it. | `noAgreement`: No Agreement covers the Bill, so it goes to the Founder before anything is paid. |
| [Pay bills](/workflows/processes/payables/pay-bills) 3. Pay the Bill before its due date. | Goes to the [Finance Lead](/agents/finance/finance-lead). |

## Loop
| Step | Value |
| --- | --- |
| Hypothesis | Paying each Bill on its due date, not on receipt, keeps more cash on hand with no late fees. |
| Measure | [Default alive](/agents/founding#default-alive) over 90d, at least 30 observations |
| Learn | The learn step reads the Readout, records Evidence and a Decision, and drafts the next Variant. |

## Code

**Ask**

```text
Turn on payables
```

**API**

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

**SDK**

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

await $.Process.enable({ process: 'process_1' })
```

**CLI**

```bash
npx startup-builder do Process.enable --json '{"process":"process_1"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Process.enable({ process: 'process_1' })"
  }
}
```

## Enable
On by default for every Product Template. [Process.pause](/business/nouns/process/pause) stops new Actions; Actions in progress finish.

**Ask**

```text
Approve bills under $1,000 without asking me
```

**API**

```bash
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":1000,"key":"bills.approveBelow"}'

curl -X PATCH https://api.sb/leaseline.app/settings/setting_2 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":2,"key":"bills.payBeforeDays"}'
```

**SDK**

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

await $.Setting.update({ id: 'setting_1', value: 1000, key: 'bills.approveBelow' })
await $.Setting.update({ id: 'setting_2', value: 2, key: 'bills.payBeforeDays' })
```

**CLI**

```bash
npx startup-builder do Setting.update --json '{"id":"setting_1","value":1000,"key":"bills.approveBelow"}'
npx startup-builder do Setting.update --json '{"id":"setting_2","value":2,"key":"bills.payBeforeDays"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "await $.Setting.update({ id: 'setting_1', value: 1000, key: 'bills.approveBelow' })\nreturn await $.Setting.update({ id: 'setting_2', value: 2, key: 'bills.payBeforeDays' })"
  }
}
```

## Example
A hosting [Bill](/business/nouns/bill) for $412 arrives by email. It matches the vendor’s [Agreement](/business/nouns/agreement) and falls under the $1,000 threshold. It is paid two days before its due date, and no one is asked.