---
title: "The money"
url: https://services.dev/docs/examples/sales/money
captured: [money-outcomes.txt, money-rails.txt, money-refunds.txt, sales-check.txt, sales-money.txt]
---
# The money

URL: https://services.dev/docs/examples/sales/money

> Northwind Freight's deal from its mandate to Friday's payout, each step's ledger line and the three apps' view of it, how the account's payment finds the deal, what the share is of, who funds the setter, the ways a won deal reverses, and every api.forsale deal on this site.

*sales's words: deal is a job, account is a subject, gig is a task, closer is a member, seller is a client, seller is a buyer (examples/sales/brand.ts).*

A won deal earns the brand its 5%, less the setter, the placement, the AI and services.dev's take; the closer's 10% passes through whole. A lost deal's costs are the brand's.

## Before you sell

```bash
npx services.dev check
```

```txt title="magic values: none"
  ledger  +$11,100.00 at won on $74,000 · closer $7,400.00 (share, from the seller) · setter $250.00 · placement $50.00 · AI $11.34 (example) · you $3,388.66
  lost    +$0.00 · setter $250.00 when the meeting was held · placement $50.00, the setter's gig and the closer's · AI up to $40.00 · you −$340.00 when a closer loses it
  odds    each track at the deal it takes · AI alone, $30,000: won $1,490.88, lost −$40.00 · breaks even at 2.6% won
          a setter, then AI, $40,000: won $1,714.52, lost −$315.00 · breaks even at 15.5% won, the worst bet
          a closer, $74,000: won $3,388.66, lost −$340.00 · breaks even at 9.1% won (about 1 in 11)
          gone quiet, a closer's deal: won $3,213.66, lost −$515.00 with the nurturer's $150.00 and its placement · breaks even at 13.8% won
```

A setter on a deal AI closes is the worst bet. On small deals, `setter: 'ai'` books without one.

## The deal's money

`job_7Hq5`, from the order to the closer's payout. Nothing is held until the account pays:

| Step | Fact | The ledger | Customer portal, the seller | Delivery portal | Owner console |
|---|---|---|---|---|---|
| Ordered, 2 Nov | `deal.ordered`, `charge.mandated` | +$0.00 | "charged at won, up to $12,000" | — | the deal, mandated |
| A setter books, 5 Nov | `step.committed` | placement −$25.00 at the setter's claim, debited from your balance · AI, against $40.00 | the meeting's date | the setter's $250 waits on the meeting | AI spent so far |
| A closer claims, 9 Nov | `gig.claimed` | placement −$25.00, debited | the closer's name | terms frozen: 10% at won | the gig filled |
| Meeting held, 10 Nov | `pay.accrued` | setter −$250.00, debited from your balance | "meeting held" | the setter's $250, accrued | the setter paid from your balance |
| Proposal and redlines, 11 to 18 Nov | `step.committed` | — | the proposal and the redlines | committed, the gig still hers | the closer's span |
| The close, 4 Dec | `deal.ended` | — | "won · awaiting payment · nothing charged" | "committed · your 10% waits on Northwind's payment" | won, awaiting payment |
| The payment proves it, 4 Jan | `outcome.verified`, `charge.pending` | +$11,100.00, a bank debit in flight | "$11,100 pending from your bank" | — | pending, collects in four days |
| The debit collects, 8 Jan | `charge.collected` | +$11,100.00, held | "$11,100 charged, final 9 Mar" | $7,400 held to 9 Mar | held, by the date it's final |
| The window closes, 9 Mar | `outcome.final`, `charge.earned` | you $3,388.66 before the take | final | $7,400 accrued | final, the take on $3,400.00 |
| Friday, 12 Mar | `pay.paid` | — | — | $7,400 in the bank | the closers' run |

Each Stripe call behind a row is on [flow of funds](https://services.dev/docs/money/flow-of-funds.md#money-outside-a-charge).

## How the payment finds the deal

services.dev's Stripe app drafts the close's invoice on the seller's own account, the deal's id in its metadata. A payment counts when its customer is the account and its `metadata.deal` is this deal, within 90 days of the close:

```bash
npx services.dev jobs outcome job_7Hq5 --match   # how Northwind's payment found the deal
```

```txt title="magic values: metadata.sandbox.proof = "paid""
job_7Hq5 · outcome · proof payment · through services.dev's Stripe app on Harbor Labs' account acct_…H4rb, installed at the order: it reads customers, invoices, charges, refunds and disputes, and writes only the close's invoice
  invoice   in_…8841 · drafted at the close on 4 Dec · customer cus_…N0rt, Northwind Freight · metadata.deal job_7Hq5 · net 30 · $74,000.00
  match     customer is the deal's account ✓ · metadata.deal is this deal ✓ · both, so the payment counts
  never     a payment without metadata.deal, or from another customer: Harbor's own sale, never this deal's, unless a contest rules it the same account
  paid      Mon 4 Jan 09:20 · invoice.paid · $74,000.00 by ACH · the 5% and the 10% debited from Harbor's bank, collected 8 Jan · window 60d by bank, to 9 Mar 2027
  due       90 days from the close, to 4 Mar 2027 · unpaid by then: outcome.lapsed, and nothing charged
  tail      had the deal ended lost, a payment that matched within 90 days would have won it, charged once
```

| On the seller's account | The outcome |
|---|---|
| `invoice.paid` | verified: the share is charged |
| `invoice.paid` with `paid_out_of_band` | self-reported: held until the seller attaches the remittance, then verified |
| `invoice.voided`, then a new invoice paid | the new invoice counts only if it carries this deal's `metadata.deal` |
| `charge.refunded` or `charge.dispute.created` inside the window | `outcome.adjusted` or `outcome.reversed` |
| `invoice.marked_uncollectible` | nothing charged; the tail keeps watching to `outcome.due` |

## What the share is of

`closed_value` is the first 12 months the contract commits, so a three-year deal is charged once, on its first year.

| How the account pays | What proves it | Deal |
|---|---|---|
| The first year up front | the one invoice: `collect: 'first'` | `job_7Hq5`, $74,000, net 30 |
| Billed monthly | each invoice holds its own share for 60 days: `collect: 'each'` | `job_7Ht1`, $6,166.67 a month |
| Years two and three | a renewal through `again`: a new outcome on its own payment, never a second charge on this one | the deal `again` starts |

## Who funds the setter

`deal.ts` funds the setter and the nurturer from api.forsale's 5%, each debited from its balance at the act, so nothing is charged on effort. [Who funds it](https://services.dev/docs/money/pay.md#who-funds-it) runs the sales kernel's way, charged to the seller.

## When it reverses

**Refunded on day 20**

Inside the window, both shares and the take go back from the hold. The setter's pay stands:

```txt
→ GET /owner/deals/job_7Hw6   # another won deal: its payment was refunded inside the window
```

```txt title="200 · job_7Hw6 · deal · won · reversed · $0.00 kept · magic values: none"
  proof     payment · in_…9310 refunded 3 Dec 2026, day 20 of 60
  money     outcome.reversed → chg_7Hw6 refunded $11,100.00 from the hold → the closer's $7,400.00 never left it
  ledger    +$0.00 · setter $250.00, paid at the held meeting · placement $50.00 · AI $12.02 · you −$312.02
  take      reversed with the share
```

**A referred deal**

`job_7Hr4` came through a referrer, so the seller paid 1% beside the 5% and the 10%. A refund reverses all three:

```txt
→ GET /owner/deals/job_7Hr4   # won, with a referrer
```

```txt title="200 · job_7Hr4 · deal · won · $9,920.00 charged, held to 2027-01-12 · magic values: none"
  ledger  +$9,920.00 · closer $6,200.00 (share, from the seller) · referrer $620.00 (line, from the seller) · placement $25.00 · AI $10.80 · you $3,064.20 before the take
  take    on $3,075.00 · never on the referral or the closer's share
```

**Disputed by the seller's bank**

The mandate, the proof and the close answer it, and the closer's share stays hers whatever the bank rules:

```txt
→ GET /owner/disputes/dsp_7Ht4   # a seller's bank disputed a won deal's charge
```

```txt title="200 · dsp_7Ht4 · chg_7Ht4 · api.forsale's charge · $9,300.00 · needs_response · evidence due 4 Jan 2027 · magic values: none"
  reason    fraudulent · the seller says they never authorized it
  held      $9,300.00 from the deal's own hold, under job_7Ht4
  evidence  from the record, for fraudulent
    mandate       ask_7Ht4 · Fabrikam's consent to charge up to $10,000.00 at won, signed 3 Nov 2026 · card …0005
    proof         in_…T4 · $62,000.00 paid to Fabrikam on 21 Nov 2026, read from Fabrikam's own Stripe account
    close         committed by mbr_7Hq4 · closed_value $62,000.00 · contract.pdf sha256:9b2e…11c4
    thread        22 messages · Fabrikam's, 20 Nov: "Signed. Thanks for pushing it over the line."
  member    mbr_7Hq4's $6,200.00 stays held to its window, and is theirs at outcome.final whatever the bank rules
```

A partial refund and a deal won by the tail are on [what reverses](https://services.dev/docs/money/outcomes.md#what-reverses) and [the tail](https://services.dev/docs/money/outcomes.md#the-tail).

## Every deal on this site

Each api.forsale id names one deal, wherever it appears:

| Deal | Account | What it shows | Walked on |
|---|---|---|---|
| `job_7Hq5`, gigs `tsk_7Hs5` and `tsk_7Hq5` | Northwind Freight | won by a closer, net 30, paid and held | [the walk](https://services.dev/docs/examples/sales/walk.md), [closing](https://services.dev/docs/examples/sales/delivery-portal.md), [outcomes](https://services.dev/docs/money/outcomes.md), [flow of funds](https://services.dev/docs/money/flow-of-funds.md), [plans](https://services.dev/docs/money/plans.md) |
| `job_7Hq1` | Litware Clinics | AI closes alone | [branches](https://services.dev/docs/examples/sales/branches.md#ai-alone), [outcomes](https://services.dev/docs/money/outcomes.md) |
| `job_7Hu2` | Adventure Works | a buying committee draws a closer | [the agent's order](https://services.dev/docs/examples/sales/agent.md#it-sends-what-it-learns) |
| `job_7Hu3` | Lucerne Publishing | a meeting nobody attended | [branches](https://services.dev/docs/examples/sales/branches.md#a-meeting-nobody-attended) |
| `job_7Hs3`, then `job_7Hs9` | Tailspin Toys | lost at the close, then started again | [branches](https://services.dev/docs/examples/sales/branches.md#lost) |
| `job_7Hs4` | Fabrikam Foods | gone dark, revived, closed by the same closer | [branches](https://services.dev/docs/examples/sales/branches.md#gone-dark-and-revived) |
| `job_7Hs6` | Wingtip Supply | confirmed dead | [branches](https://services.dev/docs/examples/sales/branches.md#confirmed-dead) |
| `job_7Hu9`, gigs `tsk_7Hv2` and `tsk_7Hv4` | Margie's Travel | gone dark before the meeting, revived to `book` | [branches](https://services.dev/docs/examples/sales/branches.md#gone-dark-before-the-meeting) |
| `job_7Hu4` | Coho Winery | refused, asked, and closed over the seller's new floor | [the Deal Service](https://services.dev/docs/examples/sales/deal.md#the-floor) |
| `job_7Hu7` | Fourth Coffee | no one claims | [branches](https://services.dev/docs/examples/sales/branches.md#when-no-one-claims) |
| `job_7Hu5` | Jordan Lee | a consumer close on closers.sale, by card | [deal shapes](https://services.dev/docs/examples/sales/shapes.md#a-consumer-close-on-closerssale) |
| `job_7Hu1` | Proseware | an expansion, the share on the increase | [deal shapes](https://services.dev/docs/examples/sales/shapes.md#an-expansion) |
| `job_7Hr4`, gig `tsk_7Hr4` | Alpine Freight | referred, the referrer paid at final | [deal shapes](https://services.dev/docs/examples/sales/shapes.md#referred), [lines and rails](https://services.dev/docs/money/lines-and-rails.md) |
| `job_7Hv6` | Rin Takahashi | a developer on a monthly Stripe subscription | [deal shapes](https://services.dev/docs/examples/sales/shapes.md#a-developer) |
| `job_7Hv8` | Woodgrove Bank | an agent buyer, no meeting | [deal shapes](https://services.dev/docs/examples/sales/shapes.md#an-agent-buyer) |
| `job_7Hu6` | Wide World Importers | signed, never paid | [branches](https://services.dev/docs/examples/sales/branches.md#signed-never-paid) |
| `job_7Hu8` | Alpine Ski House | paid by its parent, contested and upheld | [closing](https://services.dev/docs/examples/sales/delivery-portal.md#7-what-protects-your-pay) |
| `job_7Ht1` | Trey Research | billed monthly | [deal shapes](https://services.dev/docs/examples/sales/shapes.md#billed-monthly), [outcomes](https://services.dev/docs/money/outcomes.md#collecting-at-the-outcome) |
| `job_7Hw6` | — | refunded on day 20 | [outcomes](https://services.dev/docs/money/outcomes.md#what-reverses) |
| `job_7Hs2` | — | $18,500 refunded on day 31 | [outcomes](https://services.dev/docs/money/outcomes.md#what-reverses) |
| `job_7Hw7` | Contoso Logistics | won by the tail | [outcomes](https://services.dev/docs/money/outcomes.md#the-tail) |
| `job_7Hs8` | — | the first collection declined, then paid | [outcomes](https://services.dev/docs/money/outcomes.md#when-the-charge-fails) |
| `job_7Hr8` | — | the AI budget spent, the step sent to the setter | [prices](https://services.dev/docs/money/prices.md) |
| `job_7Ht4` | — | the brand's charge disputed by the seller's bank | [refunds and disputes](https://services.dev/docs/money/refunds-and-disputes.md#disputes) |

---

- Up: [The sales example](https://services.dev/docs/examples/sales.md)
- Previous: [The owner console](https://services.dev/docs/examples/sales/console.md)
- Next: [What the brand gets](https://services.dev/docs/examples/sales/surfaces.md)
