When to use this endpoint

Use Accounts_list for a compact account-code lookup. It is the common source for nominal selectors throughout CRM1 and CRM2.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler calls the normal login guard but performs no additional Finance-page, client-admin, role, create, edit, or delete permission check.

All reads and writes use the authenticated tenant. CRM1 and CRM2 decide whether to show finance controls, but these handlers do not repeat those client-side checks.

Parameters

ParameterTypeRequiredDescription
fieldsJSON arrayNoOptional extra-field list. Only meta is accepted; base fields id, nominal_code, name, and is_default are always returned. Invalid JSON and unknown names are silently ignored.

Example request

$accounts = FM_api('Accounts_list', [
	'fields' => json_encode(['meta']),
]);

Example response

[
  {"id":"331042","nominal_code":"4000","name":"Sales","is_default":"1","meta":null}
]

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.
[]No accounts exist.
Runtime/type errorA native array is sent as fields; this legacy endpoint passes the value directly to json_decode().

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • There is no filtering, search, pagination, limit, or explicit ordering. Callers commonly sort the result themselves.
  • Every account is returned because the table has no active or deleted flag.
  • display_name, categories, creation/edit timestamps, and other mapped fields cannot be requested here. Use Account_getRequestedDetails when needed.
  • meta remains the stored JSON string rather than being decoded.

See it in Fieldmotion

CRM1

CRM1 uses this call in Finance/DataSync settings, invoices, purchase documents, customer defaults, stock, Job Types, Schedule of Rates, import mapping, and accounting connectors.

CRM2

CRM2 uses it across the same finance workflows, including quote/invoice rows, Credit Notes, Job Types, Schedule of Rates, DataSync, Xero, QuickBooks, and Business Central.

Related endpoints