DevelopersAPI reference
Costing API
REST endpoints for costing in ServFlo: 1 operations with parameters, request and response fields, permissions and curl examples.
Base URL: https://app.servflo.ai/api. Every call needs Authorization: Bearer sfk_… (Authentication); {organizationId} ($ORGANIZATION_ID in the examples) is your business's id.
| Operation | Endpoint | Risk |
|---|---|---|
| Job costing: revenue, costs, gross profit and margin | GET /organizations/{organizationId}/jobs/{jobId}/costing | read |
Job costing: revenue, costs, gross profit and margin
GET /organizations/{organizationId}/jobs/{jobId}/costing
The job's revenue (invoiced before tax, and what was collected) against labour (time × each technician's hourly cost), materials (cost snapshots of its material lines), purchase orders for the job (beyond what was used as material) and expenses; gross profit and margin %. With the job's purchase orders and expenses. Owners and admins only (costing.read). Read-only.
| Permission | costing.read (Owner, Admin) |
| Risk | read, OAuth scope servflo.read. Read: reads only. |
| MCP tool | jobCosting_get (toolset pricebook) |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
jobId | path | string | Yes |
Example
curl "https://app.servflo.ai/api/organizations/$ORGANIZATION_ID/jobs/{jobId}/costing" \
-H "Authorization: Bearer $SERVFLO_API_KEY"Response
200: the answer's fields
| Field | Type | Description |
|---|---|---|
jobId | string | |
identifier | string | |
costing | object | |
costing.revenueCents | integer | Invoiced on the job (not cancelled), before tax; tips are not revenue. |
costing.collectedCents | integer | The part of that already paid (payments without their tax share). |
costing.labourMinutes | integer | |
costing.uncostedMinutes | integer | Time of technicians without an hourly cost (counted as 0). |
costing.labourCents | integer | Integer cents. |
costing.labour | array of object | |
costing.labour[].technicianId | string or null | |
costing.labour[].name | string or null | |
costing.labour[].minutes | integer | |
costing.labour[].hourlyCostCents | integer or null | |
costing.labour[].costCents | integer | Integer cents. |
costing.materialsCents | integer | Integer cents. |
costing.uncostedMaterialLines | integer | |
costing.purchasesCents | integer | Job purchase orders received beyond what was used as material. |
costing.expensesCents | integer | Integer cents. |
costing.totalCostCents | integer | Integer cents. |
costing.grossProfitCents | integer | Integer cents. |
costing.marginPercent | number or null | |
purchaseOrders | array of object | |
purchaseOrders[].id | string | |
purchaseOrders[].identifier | string | |
purchaseOrders[].status | string | |
purchaseOrders[].totalCents | integer | Integer cents. |
purchaseOrders[].vendor | object | |
purchaseOrders[].vendor.name | string | |
expenses | array of object | |
expenses[].id | string | |
expenses[].date | string | |
expenses[].category | string | |
expenses[].description | string or null | |
expenses[].amountCents | integer | Integer cents. |