# Supplier payouts

URL: /workflows/processes/supplier-payouts · Id: `process:supplier-payouts`

> Supplier payouts pays each Supplier for confirmed work every week, holds amounts under open Disputes, and sends each one a statement.

Supplier payouts pays each [Supplier](/business/nouns/supplier) for confirmed work every week, holds amounts under open [Disputes](/business/nouns/dispute), and sends each one a statement.

## Outcome
| Part | This Process |
| --- | --- |
| Outcome | Each Supplier is paid every week for work Customers confirmed, minus amounts held under open Disputes, with a statement for each payout. |
| Reads | [Order](/business/nouns/order), [Supplier](/business/nouns/supplier) |
| Leaves | [Transaction](/business/nouns/transaction), [Statement](/business/nouns/statement) |
| Runs in | Each Startup |

## Accountable
[Treasurer](/agents/finance/treasurer), [Finance Team](/agents/finance).

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

Consulted: [Supply Manager](/agents/operations/supply-manager), [Billing Specialist](/agents/finance/billing-specialist).

Informed: [Finance Lead](/agents/finance/finance-lead).

## Workflows
| Workflow | Runs | Team |
| --- | --- | --- |
| [Pay suppliers](/workflows/processes/supplier-payouts/pay-suppliers) | every week on Friday at 10:00 | [Finance Team](/agents/finance) |

## Who does each step

| Workflow | Step | Role | Calls | Approval |
| --- | --- | --- | --- | --- |
| [Pay suppliers](/workflows/processes/supplier-payouts/pay-suppliers) | 1. Total each Supplier’s Orders confirmed and past their clearance period. | [Treasurer](/agents/finance/treasurer) | [Order.list](/business/nouns/order/list) | None |
| [Pay suppliers](/workflows/processes/supplier-payouts/pay-suppliers) | 2. Hold the amount of every Order under an open Dispute. | [Billing Specialist](/agents/finance/billing-specialist) | [Human.hold](/business/nouns/human/hold) | None |
| [Pay suppliers](/workflows/processes/supplier-payouts/pay-suppliers) | 3. Pay each Supplier the rest. | [Treasurer](/agents/finance/treasurer) | [Human.remit](/business/nouns/human/remit) | Asks first; waits 1 business hour |
| [Pay suppliers](/workflows/processes/supplier-payouts/pay-suppliers) | 4. Send each Supplier a payout statement. | [Treasurer](/agents/finance/treasurer) | [Message.create](/business/nouns/message/create) | None |

## Events
| Direction | When | What happens |
| --- | --- | --- |
| In | Every week on Friday at 10:00 | Starts [Pay suppliers](/workflows/processes/supplier-payouts/pay-suppliers) |
| In | On [`Order.confirmed`](/business/events/Order.confirmed) | Wakes this Process, the first time only. A Customer confirms a Supplier’s first job. |
| Out | [`Human.held`](/business/events/Human.held) | Raised by step 2 of [Pay suppliers](/workflows/processes/supplier-payouts/pay-suppliers) |
| Out | [`Human.remitted`](/business/events/Human.remitted) | Raised by step 3 of [Pay suppliers](/workflows/processes/supplier-payouts/pay-suppliers) |
| Out | `Message.created` | Raised by step 4 of [Pay suppliers](/workflows/processes/supplier-payouts/pay-suppliers) |

## Plays
No Play names this Process.

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

## Settings
| Setting | Type | Default | Say | Set with |
| --- | --- | --- | --- | --- |
| `payouts.day` | `string` | `fri` | Pay suppliers on Fridays | [Setting.update](/business/nouns/setting/update) |
| `payouts.clearanceDays` | `integer` | `7` | Wait seven days after confirmation before paying out | [Setting.update](/business/nouns/setting/update) |

## Failure
A failed step retries; when retries run out, the Action goes to the [Treasurer](/agents/finance/treasurer).

| Step | On failure |
| --- | --- |
| [Pay suppliers](/workflows/processes/supplier-payouts/pay-suppliers) 3. Pay each Supplier the rest. | Goes to the [Treasurer](/agents/finance/treasurer). |

## Loop
| Step | Value |
| --- | --- |
| Hypothesis | Paying Suppliers weekly for confirmed work keeps more of them active than paying monthly, at the same Dispute losses. |
| Measure | [Fill rate](/agents/operations#fill-rate) 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 supplier payouts
```

**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 [Marketplace](/products/templates/marketplace), [Licensed-human marketplace](/products/templates/licensed-marketplace), [Services-as-Software](/products/templates/services-as-software), [E2E managed service](/products/templates/managed-service). [Process.pause](/business/nouns/process/pause) stops new Actions; Actions in progress finish.

**Ask**

```text
Pay suppliers on Fridays
```

**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":"fri","key":"payouts.day"}'

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":7,"key":"payouts.clearanceDays"}'
```

**SDK**

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

await $.Setting.update({ id: 'setting_1', value: 'fri', key: 'payouts.day' })
await $.Setting.update({ id: 'setting_2', value: 7, key: 'payouts.clearanceDays' })
```

**CLI**

```bash
npx startup-builder do Setting.update --json '{"id":"setting_1","value":"fri","key":"payouts.day"}'
npx startup-builder do Setting.update --json '{"id":"setting_2","value":7,"key":"payouts.clearanceDays"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "await $.Setting.update({ id: 'setting_1', value: 'fri', key: 'payouts.day' })\nreturn await $.Setting.update({ id: 'setting_2', value: 7, key: 'payouts.clearanceDays' })"
  }
}
```

## Example
A tutoring [Marketplace](/products/templates/marketplace) owes 38 tutors for last week’s confirmed sessions. Each tutor is paid at the end of the week, except $90 held on one disputed session. Every tutor gets a statement listing each session and the fee.