# Ask me before big refunds

URL: /workflows/guides/ask-me-before-big-refunds · Id: `guide:ask-me-before-big-refunds`

> Refunds up to your line go out without you; anything larger waits for your yes, with the Order and the reason attached.

The billing agent sends refunds up to your line and tells the [Customer](/business/nouns/customer) in the same conversation. Anything larger becomes an [Approval](/business/nouns/approval) with the [Order](/business/nouns/order), the amount and the reason.

Needs: [Take a payment](/systems/finance/take-a-payment)

**Before it runs**

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

## What you get
- 1 refund line at $250: smaller refunds go out without asking you (Setting)
- 1 refund within the line, sent through Stripe, with the Customer told in the Conversation that asked (Order)
- 1 Approval for each refund over the line, with the Order, the amount and the reason (Approval)
- 1 Billing Process switched on, if it was off (Process)

## Your agent does
**For agents**

- Guide: `guide:ask-me-before-big-refunds`, status `live`. Page: [/workflows/guides/ask-me-before-big-refunds.md](/workflows/guides/ask-me-before-big-refunds.md).
- Approval: none. Run it when the founder asks.
- Leaves the chat: never.
- Needs first: [Take a payment](/systems/finance/take-a-payment).
- 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 `"refunds.limit"`; `value` json: example `250` | `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": "refunds.limit",
    "value": 250
  },
  "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 “Raise the line to $500”, or “Ask me before every refund this month”.

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

Ask:

```text
Ask me before big refunds.
Refund up to $250 without asking me.
Hold any refund over $250 for my yes.
```

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":250,"key":"refunds.limit"}'
```

SDK:

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

await $.Process.enable({ process: 'process_billing' })
await $.Setting.update({ id: 'setting_1', value: 250, key: 'refunds.limit' })
```

CLI:

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

MCP:

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

## Change it
- Raise the line to $500.
- Ask me before every refund this month.
- Show me every refund from last month.

## Under the hood
- Systems: [Billing](/systems/billing), [Ledger](/systems/ledger), [Work queue](/agents/work-queue)
- Nouns: [Order](/business/nouns/order), [Approval](/business/nouns/approval), [Limit](/business/nouns/limit), [Setting](/business/nouns/setting), [Process](/business/nouns/process)
- Events: [`Order.refunded`](/business/events/Order.refunded), [`Process.enabled`](/business/events/Process.enabled)
- Stripe objects: `Refund`

Every refund runs [Issue a refund](/workflows/processes/billing/issue-refund), the body of [`Order.refund`](/business/nouns/order/refund), whoever asks for it. It checks the amount against `refunds.limit` on the [Billing](/workflows/processes/billing) [Process](/business/nouns/process), which starts at $100. Refund small amounts fast: $40 back today costs less than a chargeback next month.

This line covers every refund. To give only the support agent its own smaller line, [let the support agent refund up to $50](/agents/let-an-agent-refund).