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

ParameterTypeRequiredDescription
aidInteger stringYesPositive asset ID. The handler does not verify that the asset row exists or is active.
drawInteger stringNoDataTables token; defaults to 0.
startInteger stringNoZero-based offset; defaults to 0.
lengthInteger stringNoPage size; defaults to 10. An explicit zero remains zero.
dateFrom / dateToLocal date/time stringNoParsed 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 / orderDataTables valuesNoSent 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

ResponseCondition
{"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_id matches. For an older invoice with no parsed rows, the entire invoice total is attributed to the linked job.
  • recordsTotal and recordsFiltered normally 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