# Pay suppliers every week

URL: /workflows/guides/pay-suppliers-every-week · Id: `guide:pay-suppliers-every-week`

> Once a week each Supplier is paid for jobs confirmed three days earlier, minus anything under an open Dispute.

Once a week each [Supplier](/business/nouns/supplier) is paid for the jobs [Customers](/business/nouns/customer) confirmed at least three days earlier. Anything under an open [Dispute](/business/nouns/dispute) waits.

Needs: [Supplier](/business/nouns/supplier)

**Before it runs**

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

## What you get
- 1 payout each Friday per Supplier, for jobs confirmed three or more days ago (Transaction)
- 1 hold on any amount under an open Dispute (Dispute)
- 1 statement per Supplier, listing each job paid (Message)
- 1 Supplier payouts Process, on (Process)

## Your agent does
**For agents**

- Guide: `guide:pay-suppliers-every-week`, status `live`. Page: [/workflows/guides/pay-suppliers-every-week.md](/workflows/guides/pay-suppliers-every-week.md).
- Approval: none. Run it when the founder asks.
- Leaves the chat: never.
- Needs first: [Supplier](/business/nouns/supplier).
- 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_supplier_payouts"` | `process` Process |
| 2 | [`Setting.update`](/business/nouns/setting/update) (`verb:Setting.update`) | `id` string, required: example `"setting_1"`; `key` string: example `"payouts.clearanceDays"`; `value` json: example `3` | `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": "payouts.clearanceDays",
    "value": 3
  },
  "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 “Pay on Mondays instead”, or “Ask me before any payout over $2,000”.

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

Ask:

```text
Pay suppliers every Friday.
Pay contractors for finished jobs.
Hold payouts on disputed orders.
```

API:

```bash
# 1. Process.enable
curl -X POST https://api.sb/leaseline.app/processes/process_supplier_payouts/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":3,"key":"payouts.clearanceDays"}'
```

SDK:

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

await $.Process.enable({ process: 'process_supplier_payouts' })
await $.Setting.update({ id: 'setting_1', value: 3, key: 'payouts.clearanceDays' })
```

CLI:

```bash
npx startup-builder do Process.enable --json '{"process":"process_supplier_payouts"}'
npx startup-builder do Setting.update --json '{"id":"setting_1","value":3,"key":"payouts.clearanceDays"}'
```

MCP:

```json
{
  "name": "do",
  "arguments": {
    "code": "await $.Process.enable({ process: 'process_supplier_payouts' })\nreturn await $.Setting.update({ id: 'setting_1', value: 3, key: 'payouts.clearanceDays' })"
  }
}
```

## Change it
- Pay on Mondays instead.
- Ask me before any payout over $2,000.
- Hold everything for this Supplier until I say.

## Under the hood
- Systems: [Earnings](/systems/payouts), [Ledger](/systems/ledger)
- Nouns: [Supplier](/business/nouns/supplier), [Order](/business/nouns/order), [Dispute](/business/nouns/dispute), [Setting](/business/nouns/setting)
- Events: [`Order.confirmed`](/business/events/Order.confirmed), [`Bill.paid`](/business/events/Bill.paid)
- Stripe objects: `Transfer`, `Payout`

Suppliers stay when they are paid on time, every week, with a statement that matches their own records. The clearance days give a Customer room to report a problem before the money leaves.