---
title: "Every branch"
url: https://services.dev/docs/examples/sales/branches
captured: [sales-branches.txt]
---
# Every branch

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

> Every way an api.forsale deal goes, run in the sandbox with no person and no Stripe. AI alone, a meeting nobody attended, lost, gone dark and revived, gone dark before the meeting, confirmed dead, no one claims, signed and never paid, and a lost deal started again, each picked by the value that produces it.

*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).*

Every branch runs in the sandbox, with no person and no outside system, picked by the value in its row. A consumer's card, an expansion and a referral are [every deal shape](https://services.dev/docs/examples/sales/shapes.md).

| Value | The branch | Walked on |
|---|---|---|
| `input.value` under `policy.humans_from` | AI closes alone, and no person is paid | below |
| `input.value` of $30,000 and the signal `committee` | a closer takes a deal under `humans_from`, and keeps it to the end | [The agent's order](https://services.dev/docs/examples/sales/agent.md#it-sends-what-it-learns) |
| `account.email = replies@example.test` | a reply raises `warm`: a setter, then a closer, then won | [One deal, every side](https://services.dev/docs/examples/sales/walk.md) |
| `account.email = noshow@example.test` | no one attends the first meeting: refused at the gate, rebooked, held, paid once | below |
| `account.email = declines@example.test` | the account says no at the close: lost, and nothing charged | below |
| `account.email = silent@example.test` | the account silent for `stall_days`: a nurturer revives it, back to the step it left, with its closer first | below |
| `account.email = ghost@example.test` | the account goes quiet before a meeting is set: revived, back to `book`, the setter paid once | below |
| `metadata.sandbox.members = { nurture: [{ revived: false }] }` | the nurturer confirms it dead: lost, and the nurturer paid | below |
| `metadata.sandbox.members = { close: [{ closed_value: 50000 }, …] }` | the gate refuses the first close, below the floor | [The Deal Service](https://services.dev/docs/examples/sales/deal.md#the-floor) |
| `metadata.sandbox.members = { close: [{ closed_value: 58000 }, { ask: { floor: 0.7 } }, …] }` | refused, then asked: the seller sets the floor for this deal, and the close commits | [The Deal Service](https://services.dev/docs/examples/sales/deal.md#the-floor) |
| `metadata.sandbox.members = { close: [] }` | no closer claims: the gig reopens to the next tier, and the deal waits | below |
| `metadata.sandbox.proof = "paid"` | the account pays the seller's invoice on its terms | [One deal, every side](https://services.dev/docs/examples/sales/walk.md) |
| `metadata.sandbox.proof = "unpaid@90d"` | signed, and never paid: `outcome.lapsed`, and nothing charged | below |
| `metadata.sandbox.proof = "refunded@20d"` | the payment is refunded on day 20: every share reverses | [The money](https://services.dev/docs/examples/sales/money.md#when-it-reverses) |
| `metadata.sandbox.proof = "refunded:18500@31d"` | $18,500 refunded on day 31: every share moves pro rata | [The money](https://services.dev/docs/examples/sales/money.md#when-it-reverses) |
| `metadata.sandbox.proof = "tail@17d"` | marked lost, then paid by the same account: won by the tail | [The money](https://services.dev/docs/examples/sales/money.md#when-it-reverses) |

## AI alone

Under `humans_from`, no gig is posted. The deal costs its AI, and the 5% is all yours:

```txt
→ POST /deals {"account":{"name":"Litware Clinics","email":"replies@example.test"},"value":30000,"offer":"https://harbor.example/route-planner","max_usd":1500,"payment_method":"pm_…","key":"litware"}
```

```txt title="captured/sales-branches.txt · 201 · job_7Hq1 · deal · working · mandated · up to $1,500.00, charged at won · magic values: account.email picks how the account answers; metadata.sandbox.members picks what each person proposes; metadata.sandbox.proof picks how the payment goes; the deal's value and signals pick who closes"
  14 Oct    book · ai · committed · meet · ai · held: the account attended 26 minutes · no setter, no closer
  16 Oct    close · ai · committed · closed_value $30,000 · under humans_from, so AI meets and closes
  20 Oct    outcome.verified · in_…5520 · $30,000.00 paid · charge.collected $1,500.00, held to 19 Dec
  ledger    +$1,500.00 · AI $9.12 of $40.00 · no person, no placement · you $1,490.88 before the take
```

## A meeting nobody attended

The setter is paid at `meet.held`, so the gate reads the calendar. He rebooks, it holds, and he is paid once:

```txt
→ POST /deals {"account":{"name":"Lucerne Publishing","email":"noshow@example.test","domain":"lucerne.example"},"value":45000,"offer":"https://harbor.example/route-planner","max_usd":2250,"payment_method":"pm_…","key":"lucerne"}
```

```txt title="captured/sales-branches.txt · 201 · job_7Hu3 · deal · working · mandated · up to $2,250.00, charged at won · magic values: account.email picks how the account answers; metadata.sandbox.members picks what each person proposes; metadata.sandbox.proof picks how the payment goes; the deal's value and signals pick who closes"
  6 Nov     book · setter · tsk_7Hu3 · mbr_7Hs1 · committed · the meeting set for 10 Nov 15:00
  10 Nov    meet · ai · refused · guard_refused · held: no one from the account stayed 10 minutes · back to book · tsk_7Hu3 stays his, unpaid
  10 Nov    book · setter · rebooked for 12 Nov 15:00 · the calendar invite from harbor.example
  12 Nov    meet · ai · committed · held: evt_…7Hu3, j.kim@lucerne.example attended 41 minutes · meet.held · pay.accrued $250.00, once
```

## Lost

The meeting was held, so the setter keeps the $250. The deal ends lost, `competitor`, and the mandate is never charged:

```txt
→ POST /deals {"account":{"name":"Tailspin Toys","email":"declines@example.test"},"value":40000,"offer":"https://harbor.example/route-planner","max_usd":2000,"payment_method":"pm_…","key":"tailspin"}
```

```txt title="captured/sales-branches.txt · 201 · job_7Hs3 · deal · working · mandated · up to $2,000.00, charged at won · magic values: account.email picks how the account answers; metadata.sandbox.members picks what each person proposes; metadata.sandbox.proof picks how the payment goes; the deal's value and signals pick who closes"
  3 Nov     book · setter · mbr_7Hs1 · committed · meet · ai · held 38 minutes · meet.held · pay.accrued $250.00
  10 Nov    close · ai · committed · no: "we're renewing with our current vendor" · next lost
  10 Nov    deal.ended · lost · competitor · the mandate is never charged
  ledger    +$0.00 · setter $250.00, paid at the held meeting · placement $25.00 · AI $40.00 · you −$315.00
```

## Gone dark, and revived

Fourteen days with no word from the account raise `gone_dark`, and the closer's gig is withdrawn, never counted against her. Revived, the deal returns to `propose`, Dana's first for 24 hours:

```txt
→ POST /deals {"account":{"name":"Fabrikam Foods","email":"silent@example.test"},"value":60000,"offer":"https://harbor.example/route-planner","max_usd":9000,"payment_method":"pm_…","key":"fabrikam"}
```

```txt title="captured/sales-branches.txt · 201 · job_7Hs4 · deal · working · mandated · up to $9,000.00, charged at won · magic values: account.email picks how the account answers; metadata.sandbox.members picks what each person proposes; metadata.sandbox.proof picks how the payment goes; the deal's value and signals pick who closes"
  4 Nov     book · setter · tsk_7Ht2 · mbr_7Hs1 · committed · meet · escalated · closer · tsk_7Ht3 claimed by mbr_7Hq4
  5 Nov     meet · person · closer · mbr_7Hq4 · held 29 minutes · meet.held · the setter's pay.accrued $250.00
  6 Nov     propose · person · closer · committed · then nothing from the account, whatever she sends
  20 Nov    signal.raised · gone_dark · the account silent 14 days (stall_days, of: 'account') · goto nurture · interrupted propose
  20 Nov    tsk_7Ht3 · gig.withdrawn · nothing done to pay: a share pays only at won · gone_dark never counts on her record
  20 Nov    nurture · routed · tsk_7Ht5 posted at $150 · claimed by mbr_7Ht2, Marcus Webb
  29 Nov    nurture · person · nurturer · mbr_7Ht2 · committed · revived: "budget moved to Q1, they want a call" · pay.accrued $150.00 · next propose, job.record.interrupted
  29 Nov    propose · the closer's span · tsk_7Ht6 offered to mbr_7Hq4 first, who held tsk_7Ht3 · first call for 24h
  30 Nov    tsk_7Ht6 · claimed by mbr_7Hq4 at 09:05, inside her 24 hours · the brief from tsk_7Ht3 carried over
  4 Dec     close · person · closer · mbr_7Hq4 · committed · closed_value $52,000 · won
  7 Dec     outcome.verified · in_…4410 · $52,000.00 paid · charge.collected $7,800.00, held to 5 Feb 2027
  ledger    +$7,800.00 · closer $5,200.00 (share, from the seller) · setter $250.00 · nurturer $150.00 · placement $100.00 · AI $13.06 · you $2,086.94 before the take
```

## Gone dark before the meeting

With no meeting held, the setter's gig accrues nothing. Revived, the deal returns to `book`, and the held meeting pays him once:

```txt
→ POST /deals {"account":{"name":"Margie's Travel","email":"ghost@example.test"},"value":35000,"offer":"https://harbor.example/route-planner","max_usd":1750,"payment_method":"pm_…","key":"margies"}
```

```txt title="captured/sales-branches.txt · 201 · job_7Hu9 · deal · working · mandated · up to $1,750.00, charged at won · magic values: account.email picks how the account answers; metadata.sandbox.members picks what each person proposes; metadata.sandbox.proof picks how the payment goes; the deal's value and signals pick who closes"
  2 Nov     signal.raised · warm · tsk_7Hv2 · setter · book · claimed by mbr_7Hs1
  16 Nov    signal.raised · gone_dark · the account silent 14 days · goto nurture · interrupted book
  16 Nov    tsk_7Hv2 · gig.withdrawn · no meeting held, so nothing accrued · never counts on his record
  24 Nov    nurture · person · nurturer · mbr_7Ht2 · revived: "back from the trade show" · pay.accrued $150.00 · next book
  24 Nov    book · setter · tsk_7Hv4 · claimed by mbr_7Hs1 · committed · the meeting set for 1 Dec
   1 Dec    meet · ai · held 27 minutes · meet.held · tsk_7Hv4 · pay.accrued $250.00, once for the deal
  ledger    so far · setter $250.00 · nurturer $150.00 · placement $50.00 · AI $15.10 · nothing charged
```

## Confirmed dead

Confirming a deal dead is the act the nurturer's gig pays for, so the $150 stands:

```txt
→ POST /deals {"account":{"name":"Wingtip Supply","email":"silent@example.test"},"value":55000,"offer":"https://harbor.example/route-planner","max_usd":8250,"payment_method":"pm_…","key":"wingtip","metadata":{"sandbox":{"members":{"nurture":[{"revived":false}]}}}}
```

```txt title="captured/sales-branches.txt · 201 · job_7Hs6 · deal · working · mandated · up to $8,250.00, charged at won · magic values: account.email picks how the account answers; metadata.sandbox.members picks what each person proposes; metadata.sandbox.proof picks how the payment goes; the deal's value and signals pick who closes"
  20 Nov    signal.raised · gone_dark · goto nurture · the closer's gig withdrawn
  27 Nov    nurture · person · nurturer · mbr_7Ht2 · committed · not revived: "they signed with a competitor on the 15th" · pay.accrued $150.00 · next lost
  27 Nov    deal.ended · lost · competitor · the nurturer's $150.00 stands: confirming a deal dead is the act the gig pays for
  ledger    +$0.00 · setter $250.00 · nurturer $150.00 · placement $75.00 · AI $12.40 · you −$487.40
```

## When no one claims

The hold lapses and the gig reopens to the next tier's feed, the same gig at the same pay. The deal waits for a person, and AI never takes it back:

```txt
→ POST /deals {"account":{"name":"Fourth Coffee","email":"replies@example.test"},"value":90000,"offer":"https://harbor.example/route-planner","max_usd":13500,"payment_method":"pm_…","key":"fourth","metadata":{"sandbox":{"members":{"close":[]}}}}
```

```txt title="captured/sales-branches.txt · 201 · job_7Hu7 · deal · working · mandated · up to $13,500.00, charged at won · magic values: account.email picks how the account answers; metadata.sandbox.members picks what each person proposes; metadata.sandbox.proof picks how the payment goes; the deal's value and signals pick who closes"
  12 Nov    meet · escalated · closer · tsk_7Hu7 posted to the enterprise feed · the setter booked it for 19 Nov
  14 Nov    tsk_7Hu7 · unclaimed for 48h · reopens to the midmarket feed, the same gig and pay
  16 Nov    tsk_7Hu7 · unclaimed · the deal waits at meet, never handed back to AI · the owner console lists it open past its hold
  ledger    +$0.00 so far · the setter's $250.00 waits on a held meeting · placement $25.00 · AI $14.80 · nothing charged
```

## Signed, never paid

Nothing is charged. The flat pay stands, the closer earns nothing and loses nothing, and the tail keeps watching the account:

```txt
→ GET /owner/deals/job_7Hu6
```

```txt title="magic values: account.email picks how the account answers; metadata.sandbox.members picks what each person proposes; metadata.sandbox.proof picks how the payment goes; the deal's value and signals pick who closes"
← job_7Hu6 · Wide World Importers · won 2 Dec · lapsed · nothing charged
  2 Dec     close · person · closer · committed · closed_value $66,000 · pay_link in_…6604, net 30
  2 Mar     outcome.lapsed · in_…6604 unpaid 90 days after the close (outcome.due) · the charge never runs
  stands    the setter's $250.00 · placement $50.00 · AI $12.10 · you −$312.10
  closer    tsk_7Hu6 earns nothing yet, and it never counts against her · the tail watches the account to 31 May 2027
```

## Started again

A lost deal is final. `again` starts a new deal with `from:` on its record, so the loss still counts:

```txt
→ POST /deals/job_7Hs3/end {"end":"lost"}
```

```txt title="409 · end_not_allowed · job_7Hs3 ended lost on 10 Nov, for good · next again · magic values: account.email picks how the account answers; metadata.sandbox.members picks what each person proposes; metadata.sandbox.proof picks how the payment goes; the deal's value and signals pick who closes"
← 409 · end_not_allowed · job_7Hs3 ended lost on 10 Nov, for good · next again
```

```txt
→ POST /deals/job_7Hs3/again
```

```txt title="402 · OFFER · A new deal for Tailspin Toys, from job_7Hs3. Nothing on effort. 5% of the closed value when it is won, proven by the payment. · magic values: account.email picks how the account answers; metadata.sandbox.members picks what each person proposes; metadata.sandbox.proof picks how the payment goes; the deal's value and signals pick who closes"
  from      job_7Hs3 · lost 10 Nov · its loss stays on its record and on every track record it touched
  next      POST /deals/job_7Hs3/again {"max_usd":2000,"payment_method":"pm_…","key":"again-job_7Hs3"}
```

```txt
→ POST /deals/job_7Hs3/again {"max_usd":2000,"payment_method":"pm_…","key":"again-job_7Hs3"}
```

```txt title="201 · job_7Hs9 · deal · working · mandated · from job_7Hs3 · up to $2,000.00, charged at won · magic values: account.email picks how the account answers; metadata.sandbox.members picks what each person proposes; metadata.sandbox.proof picks how the payment goes; the deal's value and signals pick who closes"
← 201 · job_7Hs9 · deal · working · mandated · from job_7Hs3 · up to $2,000.00, charged at won
```

[Magic values](https://services.dev/docs/reference/magic-values.md) lists every value the sandbox reads.

---

- Up: [The sales example](https://services.dev/docs/examples/sales.md)
- Previous: [The agent's order](https://services.dev/docs/examples/sales/agent.md)
- Next: [Every deal shape](https://services.dev/docs/examples/sales/shapes.md)
