Accounts and tax types
List nominal accounts
/a/Accounts_list
Return the tenant’s complete nominal account list for selectors and finance integrations.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
fields | JSON array | No | Optional 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
| 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. |
[] | No accounts exist. |
Runtime/type error | A 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. UseAccount_getRequestedDetailswhen needed.metaremains 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
Account_getRequestedDetailssupports mapped exact filters and ordering.Account_listCategoriesobtains tax types after an account is chosen.