Assets
List asset financials
/a/Asset_financialsGetDT
Return a page of direct asset jobs with cost and linked-invoice totals for the CRM1 financials table.
When to use this endpoint
Use Asset_financialsGetDT to reproduce the CRM1 asset Financials table.
Use Asset_getFinancialExportData for the field-selectable CSV export workflow.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.
The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
aid | Integer string | Yes | Positive asset ID. The handler does not verify that the asset row exists or is active. |
draw | Integer string | No | DataTables token; defaults to 0. |
start | Integer string | No | Zero-based offset; defaults to 0. |
length | Integer string | No | Page size; defaults to 10. An explicit zero remains zero. |
dateFrom / dateTo | Local date/time string | No | Parsed when dateFrom is present, and dateTo is then read as well. Due to a legacy ordering bug, the resulting date predicates are never applied. |
search / order | DataTables values | No | Sent by CRM1 but ignored. Rows are always ordered by job ID ascending. |
Example request
$page = FM_api('Asset_financialsGetDT', [
'aid' => '4821',
'draw' => '1',
'start' => '0',
'length' => '10',
]);
Example response
{
"draw": 1,
"recordsTotal": 1,
"recordsFiltered": 1,
"data": [
[7719, "JOB-7719", ["1", null, "Compressor 4"], "2026-09-24 09:00:00", ["125.00", "2.5", "50.00", "Alex Morgan"], ["24", "8", "18.00"], ["[{...}]", "40.00"], [52.5, 12.5, 40], 120, 60, [100, 20, 0], 300, "0"]
]
}
Rows are [jobId, jobRef, [customerType, customerName, assetName], localJobTime, [labourCost, hours, userHourlyCost, worker], [distance, vehicleId, mileageCost], [stockUsedJson, stockCost], [estimatedSorCost, sorStockCost, sorLabourCost], invoicedStock, invoicedSor, [invoicedLabour, invoicedMileage, invoicedMisc], totalInvoiced, formType].
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error":"missing or invalid parameter: aid"} | aid is absent, zero, or otherwise not positive. This validation occurs before the explicit login check. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Only non-deleted jobs directly assigned to the asset are included. A legacy customer-type branch exists in the predicate, but for this asset ID it can also include customer jobs with a nonzero form type when customer and asset IDs collide.
- SOR estimates use current stock average costs and current SOR labour definitions. Repeated SOR quantities do not multiply the computed stock or labour estimate in this endpoint.
- Invoice totals include only invoice rows whose
job_idmatches. For an older invoice with no parsed rows, the entire invoice total is attributed to the linked job. recordsTotalandrecordsFilterednormally match because no effective user filter is applied. The endpoint is read-only.
See it in Fieldmotion
CRM1
Open an asset’s Financials tab and filter Network requests for Asset_financialsGetDT.
CRM2
No direct production CRM2 caller was found; CRM2 has a separate mapped financial table route.
Related endpoints
Asset_financialsGetDataTableis the mapped CRM2-shaped alternative.Asset_getFinancialExportDatadrives selectable financial exports.