# Commission

URL: /business/nouns/commission · Id: `noun:commission`

> A Commission is what a Partner earns on the collected revenue its Referral brings, at a rate over a term, paid after a clawback window.

A Commission is what a [Partner](/business/nouns/partner) earns on the collected revenue its [Referral](/business/nouns/referral) brings, at a rate over a term, paid after a clawback window.

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `rate` | `number` | Yes | The share of collected revenue earned, as a percent, such as 20. Never randomized. |
| `term` | `integer` | Yes | Months after the first payment over which revenue earns the rate, such as 12. Never randomized. |
| `clawbackDays` | `integer` | Yes | Days a payment waits before it earns, so a refund inside the window earns nothing. |
| `earned` | `money` | No | Collected revenue net of refunds, times the rate, for payments past the clawback window. |
| `paid` | `money` | No | What has reached the Partner so far. |

## Object
```json
{
  "$id": "https://api.sb/patentpad.com/commissions/commission_1",
  "$type": "Commission",
  "rate": 1,
  "term": 1,
  "clawbackDays": 1,
  "earned": {
    "amount": 499,
    "currency": "USD"
  },
  "paid": {
    "amount": 499,
    "currency": "USD"
  }
}
```

## Relationships
- <a id="rel-referral"></a>A Commission **has** one [Referral](/business/nouns/referral): the Commission a [Partner](/business/nouns/partner)’s [Referral](/business/nouns/referral) earns on the revenue it brings, self-serve or through a [Deal](/business/nouns/deal). `referral`, inverse [`earns`](/business/nouns/referral#rel-earns).

## Verbs
| Verb | Description | Subject | Event | Class |
| --- | --- | --- | --- | --- |
| [Commission.pay](/business/nouns/commission/pay) | Pay transfers a Commission’s earned, unpaid amount to the Partner’s connected account through Stripe. | [Billing Specialist](/agents/finance/billing-specialist) | [`Commission.paid`](/business/events/Commission.paid) | One-way (money): `send`, `do` |
| <a id="create"></a>[Commission.create](/business/nouns/commission/create) | Creates a Commission. Inherited from [Noun](/business/nouns/noun). | None. | `Commission.created` | Two-way: `try`, `send`, `do` |
| <a id="get"></a>[Commission.get](/business/nouns/commission/get) | Returns one Commission by id. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="list"></a>[Commission.list](/business/nouns/commission/list) | Returns Commissions, newest first, one page at a time. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="update"></a>[Commission.update](/business/nouns/commission/update) | Changes the given properties of a Commission. Inherited from [Noun](/business/nouns/noun). | None. | `Commission.updated` | Two-way: `try`, `send`, `do` |

## Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.

| Operation | `owner` | `admin` | `member` | `viewer` |
| --- | --- | --- | --- | --- |
| `Commission.create` | Yes | Yes | Yes | No |
| `Commission.get` | Yes | Yes | Yes | Yes |
| `Commission.list` | Yes | Yes | Yes | Yes |
| `Commission.update` | Yes | Yes | Yes | No |
| `Commission.pay` | Yes | No | No | No |

## Call it

**Ask**

```text
Pay the latest commission.
```

**API**

```bash
curl -X POST https://api.sb/routewise.dev/commissions/commission_1/pay \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/routewise.dev",
  "commission": {
    "$id": "https://api.sb/routewise.dev/commissions/commission_1",
    "$type": "Commission",
    "rate": 1,
    "term": 1,
    "clawbackDays": 1
  },
  "transaction": {
    "$id": "https://api.sb/routewise.dev/transactions/transaction_1",
    "$type": "Transaction",
    "kind": "charge",
    "amount": {
      "amount": 25,
      "currency": "USD"
    }
  },
  "action": {
    "$id": "https://api.sb/routewise.dev/actions/action_1",
    "operation": "Commission.pay",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/routewise.dev/actions/action_1"
  }
}
```

**SDK**

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

const { commission, transaction } = await $.Commission.pay({ commission: 'commission_1' })
```

**CLI**

```bash
npx startup-builder do Commission.pay --json '{"commission":"commission_1"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Commission.pay({ commission: 'commission_1' })"
  }
}
```

## Example
An accounting firm refers a client to a payroll app on a Commission of 20% for 12 months with a 30-day clawback. The client pays $300 a month, so the firm earns $60 a month once each payment clears the window.