When to use this endpoint

Use Account_getRequestedDetails when a CRM2-style consumer needs selected mapped account fields with exact filters rather than the fixed Accounts_list shape.

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
fieldsNative arrayNoMapped response names from id, name, nominalCode, displayName, default, and meta. Omission selects every mapped field; unknown names are skipped and id is always added.
id / idsInteger-compatible or native arrayNoExact account-ID filter. A scalar becomes one ID; array members are integer-converted. id takes precedence when both are present.
name / nominalCode / displayName / metaString or native arrayNoCase-insensitive exact filter, or exact lowercased list. These are not substring filters.
defaultInteger-compatible or native arrayNoExact is_default filter.
orderString, object, or native arrayNoMapped ordering. A field string is ascending; an object such as {"id":"name","dir":"desc"} selects direction.
advanceSearchNative arrayNoShared mapped condition objects used by internal CRM2 widgets.

Example request

$accounts = FM_api('Account_getRequestedDetails', [
	'fields' => ['id', 'nominalCode', 'name'],
	'order' => [['id' => 'nominalCode', 'dir' => 'asc']],
]);

Example response

[
  {"id":"331042","nominalCode":"4000","name":"Sales"}
]

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 account matches; unknown fields are ignored rather than rejected.
Runtime/type errorfields is supplied as a JSON string instead of a native array.

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 pagination or limit. Without order, database order is unspecified.
  • Accounts have no soft-delete flag, so every stored account row is eligible.
  • meta remains the stored JSON string. CRM2’s Job Types loader requests an unmapped description field; the helper silently omits it.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found. CRM1 uses the fixed Accounts_list and finance-specific lookup routes.

CRM2

Open an Invoice, Job Type, or table-invoice editor. CRM2 requests selected account fields through this mapped route for pickers and row details.

Related endpoints