Contracts API
Fetch contract metadata and billing roll-up for a project's contracted version.
GET /api/v1/contracts/{id}
Get a contract's metadata. Includes the frozen approval snapshot (rates, total amount, billed-to-date) plus any frozen rooms/lines persisted at approval time.
Response (200 OK)
{
"id": 88,
"versionId": 17,
"tenantId": "tenant-abc",
"approvedAt": "2025-04-18T14:05:00Z",
"approvedByUserId": "auth0|abc123",
"rates": {
"taxRate": 8.250
},
"jobSiteAddress": "123 Main St, Seattle, WA",
"shipToName": "Acme HQ",
"shipToAddress": "123 Main St, Seattle, WA",
"shipToContact": "[email protected]",
"totalAmount": 57295.90,
"amountBilledToDate": 28647.95,
"rooms": [ /* frozen room snapshots */ ],
"lines": [ /* frozen line snapshots */ ]
}
Errors
404 Not Found— contract does not exist for your tenant.
GET /api/v1/contracts/{id}/billing-summary
Roll-up of the contract's billing state plus approved Change Order totals. Includes the project's currency code, localized tax label, and the contract's snapshotted tax rate so consumers can format amounts correctly without a follow-up project lookup.
Response (200 OK)
{
"contractId": 88,
"contractTotal": 57295.90,
"contractBilled": 28647.95,
"contractRemaining": 28647.95,
"approvedChangeOrders": 1,
"changeOrderTotal": 4200.00,
"changeOrderBilled": 0.00,
"changeOrderRemaining": 4200.00,
"currency": "GBP",
"taxLabel": "VAT",
"taxRate": 20.000
}
Change Order totals are scoped
changeOrderTotal / Billed / Remaining only count approved Change Orders that are billable to the client (clientCharge: true). Internal-cost-only COs are excluded.
Errors
404 Not Found— contract does not exist for your tenant.
