---
referrals: 3
kind: program
payer: domain:vendor.example
code: vendor_si
category: enterprise
status: open
at: 2026-10-30T00:00:00Z
crit: fixed
---
# Example vendor integrator referral fee

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

In plain words: when an integrator and a smaller firm bring a deal, 7% of first-year value is split 70% and 30%, as their contract says. If only one of them touched a deal, it gets its own share and the other share stays with the payer.

Change first: `payer`, `code`, the rate and the shares. The keys under `shares` are party ids. Send a party line to `check_referrals`, and it gives you the `id`.

## Rules

### si_fee

- on: deal_won
- basis: percent
- rate: 7%
- of: first_year
- once_per: deal

## Attribution

- model: fixed
- shares.pt_f1e45cf2304418c9c4b115d2: 70%
- shares.pt_58407622f319411d38e31808: 30%
- window_days: 180
- allowed_kinds: co_sell, intro

## Settlement

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

## Example

Made-up lines. Both firms worked on the first deal. Only the integrator worked on the second.

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-09-01T00:00:00Z`.

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

```jsonl
{"type":"agreement","code":"integrator","partner":"domain:integrator.example","partner_role":"consultancy"}
{"type":"agreement","code":"boutique","partner":"domain:boutique.example","partner_role":"consultancy"}
{"type":"event","at":"2027-03-01T00:00:00Z","kind":"deal_won","source":"crm:won_s1","deal":"opp_s1","asset":"USD","contract":{"first_year":"250000.00"},"tokens":["rf1.vendor_si.integrator.si1.trnmo0.dho.n.-","rf1.vendor_si.boutique.bq1.tsj400.dhb.n.-"]}
{"type":"event","at":"2027-06-01T00:00:00Z","kind":"deal_won","source":"crm:won_s2","deal":"opp_s2","asset":"USD","contract":{"first_year":"100000.00"},"token":"rf1.vendor_si.integrator.si2.tx3xc0.dho.n.-"}
```

## Worked result

Computed by `run_ledger` as of 2027-09-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_won, 2027-03-01 | boutique | 7% of 250000.00, pot 17500.00 x 30% share | 5250.00 |  |
| deal_won, 2027-03-01 | integrator | 7% of 250000.00, pot 17500.00 x 70% share | 12250.00 |  |
| deal_won, 2027-06-01 | integrator | 7% of 100000.00 | 4900.00 |  |

| Payee | Asset | Earned | Reversed | Net | Held | Payable |
|---|---|---|---|---|---|---|
| boutique | USD | 5250.00 | 0.00 | 5250.00 | 0.00 | 5250.00 |
| integrator | USD | 17150.00 | 0.00 | 17150.00 | 0.00 | 17150.00 |


## Why these settings

`fixed` holds the split the two firms signed, so neither has to win an argument about which touch came last.
