---
referrals: 3
kind: program
payer: domain:acme.example
code: acme_saas
category: saas
status: open
at: 2026-10-30T00:00:00Z
net_of: tax, processor_fee
---
# Acme partner program

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

In plain words: a referrer earns 11% of what a customer pays, after tax and card fees, for 12 months from the customer's first payment. Each amount waits 30 days before it can be paid.

Change first: `payer`, `code`, the rate, the months, and what `net_of` says. Publish this file at `/referrals.md` on your own domain. Delete the Example and Worked result sections first, or keep them: only the terms count.

## Rules

### revenue_share

- on: payment
- basis: percent
- rate: 11%
- of: net
- recurring.months: 12

## Attribution

- model: last_touch
- window_days: 30
- allowed_kinds: link, code, content

## Settlement

- holdback_days: 30
- clawback_days: 60
- cycle: monthly
- payout_within_days: 15
- minimum_payout: 50.00
- payout_asset: USD
- rails: ach
- on_end: pay_all

## Example

Made-up lines, one fact each, as you would append them to `referrals.jsonl`. Alice's link brings a customer. The token is only needed on the first payment, since later events match on `customer`. Bob's link reaches the same customer in December, too late to count. Part of the December payment is refunded. `reverses` holds the id of the event it reverses, and `map_event` gives you each line's id when you send it the program.

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

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

```jsonl
{"type":"agreement","code":"alice","partner":"domain:alice.example"}
{"type":"agreement","code":"bob","partner":"domain:bob.example"}
{"type":"event","at":"2026-11-02T15:00:00Z","kind":"payment","source":"billing:inv_101","customer":"cu_3f9a1c07b2e84d6a","amount":"100.00","net":"95.00","asset":"USD","deductions":[{"kind":"tax","amount":"3.00"},{"kind":"processor_fee","amount":"2.00"}],"token":"rf1.acme_saas.alice"}
{"type":"event","at":"2026-12-02T15:00:00Z","kind":"payment","source":"billing:inv_102","customer":"cu_3f9a1c07b2e84d6a","amount":"100.00","net":"95.00","asset":"USD","deductions":[{"kind":"tax","amount":"3.00"},{"kind":"processor_fee","amount":"2.00"}],"token":"rf1.acme_saas.bob"}
{"type":"event","at":"2026-12-20T09:00:00Z","kind":"refund","source":"billing:re_201","customer":"cu_3f9a1c07b2e84d6a","amount":"50.00","net":"47.50","asset":"USD","reverses":"ev_2f9684728e715a1b75ee38d4"}
{"type":"event","at":"2027-01-02T15:00:00Z","kind":"payment","source":"billing:inv_103","customer":"cu_3f9a1c07b2e84d6a","amount":"200.00","net":"190.00","asset":"USD","deductions":[{"kind":"tax","amount":"6.00"},{"kind":"processor_fee","amount":"4.00"}]}
```

## Worked result

Computed by `run_ledger` as of 2027-02-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 |
|---|---|---|---|---|
| payment, 2026-11-02 | alice | 11% of 95.00 | 10.45 | disclosure_unstated |
| payment, 2026-12-02 | alice | 11% of 95.00 | 10.45 | disclosure_unstated |
| payment, 2026-12-02 | bob | This customer is locked to other touches. | 0.00 | X15 |
| refund, 2026-12-20 | alice | Reverses what was computed on payment, 2026-12-02 | -5.22 | disclosure_unstated |
| payment, 2027-01-02 | alice | 11% of 190.00 | 20.90 | disclosure_unstated |
| payment, 2027-01-02 | bob | This customer is locked to other touches. | 0.00 | X15 |

`disclosure_unstated`: The token doesn't say whether this touch was disclosed. A short link proves nothing about that, and the referrer still carries the duty.

| Payee | Asset | Earned | Reversed | Net | Held | Payable |
|---|---|---|---|---|---|---|
| alice | USD | 41.80 | -5.22 | 36.58 | 20.90 | 15.68 |


## Why these settings

A share of `net` with `net_of` written down avoids the most common commission dispute, and the customer lock that comes with `recurring.months` keeps the first referrer's credit when a later link shows up.
