Deals API
Deal Stages
type DealStage =
| 'new'
| 'qualified'
| 'showing_scheduled'
| 'showing_done'
| 'offer'
| 'under_contract'
| 'closed_won'
| 'closed_lost'Endpoints
List Deals
GET /api/dashboard/deals
Authorization: Bearer <jwt>Brokers see all brokerage deals. Agents see their own.
Get Deal
GET /api/dashboard/deals/[id]
Authorization: Bearer <jwt>Create Deal
POST /api/dashboard/deals
Authorization: Bearer <jwt>
Content-Type: application/json
{
"lead_id": "uuid",
"listing_id": "uuid",
"stage": "new"
}Update Deal Stage
PATCH /api/dashboard/deals/[id]/stage
Authorization: Bearer <jwt>
Content-Type: application/json
{ "stage": "offer" }closed_won triggers the commission cascade. This is irreversible.
Preview Commission Cascade
POST /api/dashboard/deals/[id]/cascade-preview
Authorization: Bearer <jwt>Returns:
{
"agent_split": 4200.00,
"brokerage_cut": 1800.00,
"referral": null,
"sponsor_share": 210.00,
"post_cap_bonus": null
}Finalize Deal
POST /api/dashboard/deals/[id]/finalize
Authorization: Bearer <jwt> (broker only)Marks deal as settled, triggers Ledger™ blockchain receipt, updates cap progress.
Last updated on