---
referrals: 3
kind: program
payer: domain:vendor.example
code: vendor_deals
category: enterprise
status: open
at: 2026-10-30T00:00:00Z
crit: each, sla
---
# Example vendor deal registration

Rates, amounts and names in this file are placeholders, not recommendations or market rates. Each party sets its own terms.

In plain words: a partner registers a deal, and the payer accepts one registration per deal. When the deal is won, the partner that registered before it opened earns 11% of annual contract value. A partner that helped after it opened earns 3%. Both are paid in full.

Change first: `payer`, `code`, both rates and the window. `deal` is an opaque id from your CRM, never a company's name.

## Rules

### sourced_fee

- on: deal_won
- basis: percent
- rate: 11%
- of: acv
- roles: sourced
- once_per: deal

### influenced_fee

- on: deal_won
- basis: percent
- rate: 3%
- of: acv
- roles: influenced
- once_per: deal

## Attribution

- model: each
- window_days_by_kind.deal_registration: 180
- window_days_by_kind.co_sell: 180
- exclusive_kinds: deal_registration
- allowed_kinds: deal_registration, co_sell
- match: token, deal

## Settlement

- holdback_days: 60
- clawback_days: 90
- cycle: quarterly
- payout_asset: USD
- rails: ach, wire

## SLA

| id | who | metric | target | unit | on_lapse |
|---|---|---|---|---|---|
| accept_fast | payer | deal_response_days | 5 | business_days | none |

## Example

Made-up lines. Alpha registers first and is accepted. Bravo registers the same deal later and is accepted by mistake, so the earlier registration still holds it. Charlie registers and is never accepted. The deal opens, Gamma helps after that, and the deal is won.

`deal_accepted` names a touch by its id. The `read_token` tool gives you that id as `touch_id`.

To run it, save this file as `REFERRALS.md` and these lines as `referrals.jsonl`, then run `node referrals.mjs run REFERRALS.md referrals.jsonl --as-of 2027-07-01T00:00:00Z`.

As of: 2027-07-01T00:00:00Z

```jsonl
{"type":"agreement","code":"alpha","partner":"domain:alpha.example"}
{"type":"agreement","code":"bravo","partner":"domain:bravo.example"}
{"type":"agreement","code":"charlie","partner":"domain:charlie.example"}
{"type":"agreement","code":"gamma","partner":"domain:gamma.example"}
{"type":"touch","at":"2027-01-10T09:00:00Z","token":"rf1.vendor_deals.alpha.reg1.trf2c0.dhd.n.-","kind":"deal_registration","deal":"opp_77","by":"domain:vendor.example"}
{"type":"event","at":"2027-01-12T09:00:00Z","kind":"deal_accepted","source":"crm:accept_1","deal":"opp_77","touch":"tc_8527d574a13e4e307dfdbc35"}
{"type":"touch","at":"2027-01-20T09:00:00Z","token":"rf1.vendor_deals.bravo.reg2.trxl00.dhd.n.-","kind":"deal_registration","deal":"opp_77","by":"domain:vendor.example"}
{"type":"event","at":"2027-01-21T09:00:00Z","kind":"deal_accepted","source":"crm:accept_2","deal":"opp_77","touch":"tc_e651dc3c86ba100171220078"}
{"type":"touch","at":"2027-01-22T09:00:00Z","token":"rf1.vendor_deals.charlie.reg3.ts1ac0.dhd.n.-","kind":"deal_registration","deal":"opp_77","by":"domain:vendor.example"}
{"type":"event","at":"2027-02-01T09:00:00Z","kind":"deal_opened","source":"crm:opp_77_open","deal":"opp_77"}
{"type":"touch","at":"2027-03-01T09:00:00Z","token":"rf1.vendor_deals.gamma.help1.ttzno0.dho.n.-","kind":"co_sell","deal":"opp_77","by":"domain:vendor.example"}
{"type":"event","at":"2027-04-15T09:00:00Z","kind":"deal_won","source":"crm:opp_77_won","deal":"opp_77","asset":"USD","contract":{"tcv":"360000.00","acv":"120000.00","first_year":"120000.00","term_months":36}}
```

## Worked result

Computed by `run_ledger` as of 2027-07-01T00:00:00Z, on the made-up lines above. Computed amounts are arithmetic on the records and terms you sent. They do not say what anyone owes. Your contract decides that.

| Event | Who | Working | Computed | Note |
|---|---|---|---|---|
| deal_accepted, 2027-01-12 |  | Recorded. No rule fires on this kind of event |  |  |
| deal_accepted, 2027-01-21 |  | Recorded. No rule fires on this kind of event |  |  |
| deal_opened, 2027-02-01 |  | Recorded. No rule fires on this kind of event |  |  |
| deal_won, 2027-04-15 | gamma | 3% of 120000.00 | 3600.00 |  |
| deal_won, 2027-04-15 | alpha | 11% of 120000.00 | 13200.00 |  |
| deal_won, 2027-04-15 | charlie | This kind of touch counts only after the payer accepts it. | 0.00 | X11 |
| deal_won, 2027-04-15 | bravo | An earlier accepted touch of an exclusive kind holds this. | 0.00 | X12 |

| Payee | Asset | Earned | Reversed | Net | Held | Payable |
|---|---|---|---|---|---|---|
| alpha | USD | 13200.00 | 0.00 | 13200.00 | 0.00 | 13200.00 |
| gamma | USD | 3600.00 | 0.00 | 3600.00 | 0.00 | 3600.00 |


## Why these settings

`exclusive_kinds` settles channel conflict with a written rule, and `each` lets a sourced and an influenced partner both be paid in full, which a split of one share can't do.
