# pay

URL: /business/nouns/pay-run/pay · Id: `verb:PayRun.pay` · Call: `await $.PayRun.pay({ … })` (SDK) or the `do` tool at `https://api.sb/mcp`. Inputs says what to pass, Outputs what returns, When it waits who approves.

> Pay funds an approved Pay Run: net pay to each employee’s bank on the pay date, taxes and deductions to the payroll provider.

Pay funds an approved [Pay Run](/business/nouns/pay-run): net pay to each employee’s bank on the pay date, taxes and deductions to the payroll provider.

## Inputs
| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `payRun` | [Pay Run](/business/nouns/pay-run) | Yes | The approved Pay Run. |

## Outputs
| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `payRun` | [Pay Run](/business/nouns/pay-run) | Yes | The paid Pay Run. |
| `transaction` | [Transaction](/business/nouns/transaction) | Yes | The funding Transaction. |

## Effects
- Emits [`PayRun.paid`](/business/events/PayRun.paid).
- Performed by the [Treasurer](/agents/finance/treasurer).
- One-way (money): it waits out its delay window, and runs in the `send` and `do` modes.
- Pays from the operating account, so the money must be there before the pay date.
- The payroll provider remits each withholding and files each employer return by its deadline.
- A deposit the bank returns arrives as a failed Transaction and opens a Task to pay that employee off-cycle.

## Refuses when
| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | [PayRun.pay](/business/nouns/pay-run/pay) |

## When it waits
| Gate | Default |
| --- | --- |
| Decision class | Medium: one-way, bounded (money) |
| [Delay window](/systems/trust-and-governance/controls/one-way-windows) | 1 business hour, in which a watcher can pause, redirect or cancel it; then it runs. |
| Limit | The spend [Limit](/business/nouns/limit) of the [Permission](/business/nouns/permission) or [Mandate](/business/nouns/mandate) it runs under. |
| Over the Limit | It waits `pending` for an [Approval](/business/nouns/approval) from the [Founder](/agents/founding/founder). Approved, it runs; refused, it ends `refused` with [`limit-exceeded`](/code/api/errors/limit-exceeded); unanswered by its deadline, it ends `canceled`. |

## Example

**Ask**

```text
Pay the latest pay run.
```

**API**

```bash
curl -X POST https://api.sb/shiftnote.app/pay-runs/pay_run_1/pay \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/shiftnote.app",
  "payRun": {
    "$id": "https://api.sb/shiftnote.app/pay-runs/pay_run_1",
    "$type": "PayRun",
    "company": "company_1",
    "periodStart": "2026-10-22",
    "periodEnd": "2026-10-22",
    "payDate": "2026-10-22"
  },
  "transaction": {
    "$id": "https://api.sb/shiftnote.app/transactions/transaction_1",
    "$type": "Transaction",
    "kind": "charge",
    "amount": {
      "amount": 79,
      "currency": "USD"
    }
  },
  "action": {
    "$id": "https://api.sb/shiftnote.app/actions/action_1",
    "operation": "PayRun.pay",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/shiftnote.app/actions/action_1"
  }
}
```

**SDK**

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

const { payRun, transaction } = await $.PayRun.pay({ payRun: 'pay_run_1' })
```

**CLI**

```bash
npx startup-builder do PayRun.pay --json '{"payRun":"pay_run_1"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.PayRun.pay({ payRun: 'pay_run_1' })"
  }
}
```