Cost Tracking
Overview
The Costs API provides real-time cost calculations and rollup across all estimation modules. Costs flow from individual items → scopes → bids, with automatic application of multipliers, markups, overhead, and profit.
Get Bid Costs
- Request
- Response
GET /api/costs/bid/:bidId
Cookie: sAccessToken=...; sRefreshToken=...
{
"bidId": "uuid",
"bidNumber": "BID-2025-001",
"jobName": "Shopping Center Foundation",
"moduleCosts": {
"concrete": 125000.00,
"labor": 85000.00,
"equipment": 22000.00,
"materials": 15000.00,
"subcontractor": 12000.00,
"misc": 5000.00
},
"subtotal": 264000.00,
"markups": {
"overhead": {
"percentage": 10.0,
"amount": 26400.00
},
"profit": {
"percentage": 15.0,
"amount": 43560.00
}
},
"total": 333960.00,
"scopes": [
{
"scopeId": "uuid",
"name": "Foundation",
"multiplier": 1.0,
"moduleCosts": {
"concrete": 75000.00,
"labor": 50000.00,
"equipment": 12000.00,
"materials": 8000.00,
"subcontractor": 7000.00,
"misc": 2000.00
},
"subtotal": 154000.00
},
...
]
}
Roles: ADMIN, ESTIMATOR, PM
Get Scope Costs
- Request
- Response
GET /api/costs/scope/:scopeId
Cookie: sAccessToken=...; sRefreshToken=...
{
"scopeId": "uuid",
"bidId": "uuid",
"name": "Foundation",
"multiplier": 1.0,
"moduleCosts": {
"concrete": 75000.00,
"labor": 50000.00,
"equipment": 12000.00,
"materials": 8000.00,
"subcontractor": 7000.00,
"misc": 2000.00
},
"subtotal": 154000.00,
"subtotalWithMultiplier": 154000.00,
"items": {
"concrete": [
{
"id": "uuid",
"name": "Main slab",
"quantity": 125.5,
"unit": "CY",
"unitCost": 450.00,
"totalCost": 56475.00
},
...
],
"labor": [
{
"id": "uuid",
"description": "Formwork crew",
"hours": 320,
"rate": 45.00,
"totalCost": 14400.00
},
...
]
}
}
Roles: ADMIN, ESTIMATOR, PM
Get Module Costs
- Request
- Response
GET /api/costs/module/:module/:scopeId
Cookie: sAccessToken=...; sRefreshToken=...
{
"module": "concrete",
"scopeId": "uuid",
"scopeName": "Foundation",
"items": [
{
"id": "uuid",
"name": "Main slab",
"shape": "SLAB",
"dimensions": {
"length": 50,
"width": 40,
"depth": 6
},
"squareFeet": 2000,
"cubicYards": 37.04,
"concreteCost": 16668.00,
"rebarCost": 2271.20,
"totalCost": 18939.20
},
...
],
"totalCost": 75000.00
}
Roles: ADMIN, ESTIMATOR, PM
Module Values:
concretelaborequipmentmaterialssubcontractormisc
Recalculate Bid Costs
- Request
- Response
POST /api/costs/recalculate/:bidId
Cookie: sAccessToken=...; sRefreshToken=...
{
"bidId": "uuid",
"message": "Costs recalculated successfully",
"previousTotal": 333960.0,
"newTotal": 335120.0,
"difference": 1160.0
}
Roles: ADMIN, ESTIMATOR
info
Cost recalculation is normally automatic when items are added/updated. Use this endpoint to force a full recalculation if costs appear out of sync.
Cost Rollup Flow
🔍 Click diagram to expand
Calculation Steps
- Item Costs - Individual item calculations (concrete CY _ price, labor hours _ rate, etc.)
- Scope Module Totals - Sum all items in each module within a scope
- Scope Multiplier - Apply scope multiplier (e.g., 2.0 for repeated scopes)
- Bid Module Totals - Sum all scope costs for each module
- Bid Subtotal - Sum all module costs
- Overhead - Apply overhead percentage to subtotal
- Profit - Apply profit percentage to (subtotal + overhead)
- Total - Final bid total
Example Calculation
// Scope 1: Foundation
const scope1 = {
concrete: 75000,
labor: 50000,
equipment: 12000,
materials: 8000,
subcontractor: 7000,
misc: 2000,
multiplier: 1.0
}
const scope1Total = (75000 + 50000 + 12000 + 8000 + 7000 + 2000) * 1.0 = 154000
// Scope 2: Grade Beams (repeated 2x)
const scope2 = {
concrete: 25000,
labor: 17500,
equipment: 5000,
materials: 3500,
subcontractor: 2500,
misc: 1500,
multiplier: 2.0
}
const scope2Total = (25000 + 17500 + 5000 + 3500 + 2500 + 1500) * 2.0 = 110000
// Bid totals
const bidSubtotal = 154000 + 110000 = 264000
const overhead = 264000 * 0.10 = 26400
const profit = (264000 + 26400) * 0.15 = 43560
const bidTotal = 264000 + 26400 + 43560 = 333960
Data Model
interface BidCosts {
bidId: string;
bidNumber: string;
jobName: string;
moduleCosts: ModuleCosts;
subtotal: number;
markups: Markups;
total: number;
scopes: ScopeCosts[];
}
interface ModuleCosts {
concrete: number;
labor: number;
equipment: number;
materials: number;
subcontractor: number;
misc: number;
}
interface Markups {
overhead: {
percentage: number;
amount: number;
};
profit: {
percentage: number;
amount: number;
};
}
interface ScopeCosts {
scopeId: string;
name: string;
multiplier: number;
moduleCosts: ModuleCosts;
subtotal: number;
}
Related Endpoints
- Calculations - Detailed calculation logic
- Bids - Bid operations
- Scopes - Scope management