Every deal shape
Every deal api.forsale sells from one deal.ts, each run in the sandbox from the value that picks it, with the line that handles it and what you keep.
sales's wordsdeal is a jobaccount is a subjectgig is a taskcloser is a memberseller is a clientseller is a buyer
One deal.ts sells every shape. The value in a row picks it in the sandbox, and the last column names the line of the file that handles it:
| Value | The shape | Held | The share is of | You keep | The line in deal.ts |
|---|---|---|---|---|---|
output.billing = 'annual', the default | a business pays its first year on the seller's invoice, net 30 | 60 days from the bank debit's collection | the first 12 months the contract commits: the walk | $3,388.66 | :19 output.billing, :50 outcome.collect |
output.billing = 'monthly' | billed monthly, each invoice its own proof | 60 days, each invoice | each month as it is paid | $308.33 an invoice, $3,388.66 over the 12 | :19 output.billing, :50 outcome.collect |
input.motion = 'B2C' | a consumer close on closers.sale, paid by card | 120 days, by card | what the consumer paid | $368.80 | :25 policy.stall_days, :50 outcome.window |
account.email = customer@example.test | an expansion of an account that already pays the seller | 60 days | the increase, never what they already pay | $1,191.60 | :17 input.expansion, :19 output.closed_value |
input.referrer | a referred deal | the deal's own window | the same base, 1% to the referrer beside the 5% | $3,064.20 | :17 input.referrer, :52 lines.referral |
input.motion = 'B2D' | a developer on a Stripe subscription, its first paid invoice the proof | 120 days, by card, each invoice | each month as it is paid | $235.90 over the 12 | :16 input.motion, :50 outcome.collect |
input.motion = 'B2A' | an agent buying for its principal, with no meeting | 120 days, by card | what the principal paid | $594.70 | :41 meet.when, :50 outcome.window |
Years two and three are a renewal through again, a new outcome on its own payment: what the share is of.
cat services/deal.ts held: 'meeting', closed_value: 'money: the first 12 months the contract commits, over what the account already pays', billing: ['annual', 'monthly'], term: 'months?',
window: { bank: '60d', card: '120d' }, tail: '90d', due: '90d', collect: job => (job.output.billing === 'monthly' ? 'each' : 'first') },billing: 'monthly' makes each invoice its own proof, held from its own payment. Trey Research pays a $74,000 contract by the month:
→ GET /owner/deals/job_7Ht1 # collect 'each': a $74,000.00 contract paid monthly proof payment · in_…T101 to in_…T112 on the seller's Stripe account, matched on the subscription
each $6,166.67 paid → $925.00 charged: the 5% $308.33 and the closer's $616.67, each held 60 days from its own payment
held $2,775.00 · final 11 Jan, 10 Feb and 12 Mar 2027 · 9 invoices to come
ledger each invoice +$925.00 · closer $616.67 · you $308.33 before the take · the first also carries the setter's $250.00, placement $50.00 and AI $11.34 · you $3,388.66 over the 12cat services/deal.ts stall_days: { word: 'number', default: job => (job.input.motion === 'B2C' ? 7 : 14), min: 3, max: 90 },
window: { bank: '60d', card: '120d' }, tail: '90d', due: '90d', collect: job => (job.output.billing === 'monthly' ? 'each' : 'first') },A consumer program waits 7 days before a deal goes dark. The closer sends the seller's own Checkout, and a card can be disputed longer than a bank payment, so the share is held 120 days:
→ POST /deals {"account":{"name":"Jordan Lee","email":"replies@example.test"},"value":8000,"motion":"B2C","policy":{"humans_from":5000},"offer":"https://summit.example/founder-program","max_usd":1200,"payment_method":"pm_…","key":"jordan"}
18 Nov meet · escalated · closer · tsk_7Hu5 on closers.sale · 10% at won
20 Nov close · person · closer · committed · closed_value $8,000 · pay_link cs_…7Hu5, Summit Coaching's own Checkout
20 Nov outcome.verified · cs_…7Hu5 paid by card · $8,000.00 · charge.collected +$1,200.00 held to 20 Mar 2027 · window 120d, by card
ledger +$1,200.00 · closer $800.00 (share, from the seller) · placement $25.00 · AI $6.20 · you $368.80 before the takecat services/deal.ts referrer: 'party?', expansion: 'boolean?' },
held: 'meeting', closed_value: 'money: the first 12 months the contract commits, over what the account already pays', billing: ['annual', 'monthly'], term: 'months?',An order on an account that already pays the seller answers account_is_customer, and its next offers the expansion. closed_value is only what the account adds, and the floor holds on it: $24,000 is exactly 0.8 × $30,000:
→ POST /deals {"account":{"name":"Proseware","email":"customer@example.test"},"value":30000,"offer":"https://harbor.example/route-planner","max_usd":4500,"payment_method":"pm_…","key":"proseware"}
next POST /deals {…,"expansion":true,"key":"proseware"} · the share is taken on the increase over $48,000.00, never on what they already pay→ POST /deals {"account":{"name":"Proseware","email":"customer@example.test"},"value":30000,"expansion":true,"offer":"https://harbor.example/route-planner","max_usd":4500,"payment_method":"pm_…","key":"proseware"} 3 Dec close · ai · committed · $72,000 a year from $48,000 · closed_value $24,000, the increase, exactly the floor: 0.8 × $30,000
ledger at the payment: +$1,200.00 · AI $8.40 · you $1,191.60 before the takecat services/deal.ts referrer: 'party?', expansion: 'boolean?' },
lines: { referral: { share: '1%', of: 'closed_value', to: 'referrer', on: 'won' } } },The referrer's 1% is a line on the same charge, from the seller. It is paid at outcome.final, never from the closer's pay, and a refund reverses it with the 5% and the 10%:
→ POST /deals {"account":{"name":"Alpine Freight","email":"replies@example.test"},"value":62000,"referrer":{"name":"Kai Moreno","email":"kai@moreno.example"},"offer":"https://harbor.example/route-planner","max_usd":9920,"payment_method":"pm_…","key":"alpine"}
27 Oct meet · escalated · closer · tsk_7Hr4 claimed by mbr_7Hq4 · held 34 minutes · meet.held
6 Nov close · person · closer · mbr_7Hq4 · committed · closed_value $62,000 · won
9 Nov outcome.verified · in_…7704 · $62,000.00 paid · charge.pending $9,920.00: the 5% $3,100.00, the closer's 10% $6,200.00 and the referrer's 1% $620.00, one charge from the seller
13 Nov charge.collected · held to 12 Jan 2027 · a refund before then reverses all three, pro rata if partial
cat services/deal.ts account: 'party', value: 'money: list value', motion: ['B2B', 'B2C', 'B2D', 'B2A'], offer: 'url',
window: { bank: '60d', card: '120d' }, tail: '90d', due: '90d', collect: job => (job.output.billing === 'monthly' ? 'each' : 'first') },A developer tool closes on a Stripe subscription. Its first paid invoice proves the deal, and each later one collects on its own:
→ POST /deals {"account":{"name":"Rin Takahashi","email":"replies@example.test"},"value":4800,"motion":"B2D","offer":"https://harbor.example/api","max_usd":240,"payment_method":"pm_…","key":"rin"}
2 Dec book · ai · committed · meet · ai · held: Rin attended 18 minutes of a demo of the API
4 Dec close · ai · committed · closed_value $4,800 · billing monthly · a Stripe subscription at $400.00 a month
4 Dec outcome.verified · in_…V601, the subscription's first paid invoice · $400.00 by card · charge.collected $20.00, held to 3 Apr 2027 · window 120d, by card
ledger each invoice +$20.00 · AI $4.10 off the first · you $235.90 over the 12 before the takecat services/deal.ts meet: { by: 'ai', escalate: { to: 'closer', when: person }, when: job => job.input.motion !== 'B2A',An agent buying for its principal skips meet: the deal goes from book to propose, and the agent pays with its scoped token at the seller's Checkout:
→ POST /deals {"account":{"name":"Woodgrove Bank","email":"agent@woodgrove.example"},"value":12000,"motion":"B2A","offer":"https://harbor.example/route-planner","max_usd":600,"payment_method":"pm_…","key":"woodgrove"}
1 Dec book · ai · committed · the agent's quote request, answered with the offer's terms · meet skipped, its when false for B2A
1 Dec propose · ai · committed · negotiate · ai · committed · the agent asks for annual terms
2 Dec close · ai · committed · closed_value $12,000 · pay_link cs_…7Hv8, Harbor Labs' own Checkout
2 Dec outcome.verified · cs_…7Hv8 paid by card with the agent's scoped token · $12,000.00 · charge.collected $600.00, held to 1 Apr 2027 · window 120d, by card
Every branch runs every way a deal goes. Magic values lists every value the sandbox reads.