Accounts and tax types
Retrieve mapped tax-type details
/a/AccountCategory_getRequestedDetails
Retrieve mapped tax-type details with exact filters and optional account-link expansions.
When to use this endpoint
Use AccountCategory_getRequestedDetails for CRM2 pickers and layouts that need selected category fields without table paging metadata.
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 | Native array | No | Mapped names from id, name, categoryGroupId, and taxRate, plus computed accountIDs and nameAndTaxRate. Omission returns the four mapped fields only; unknown names are skipped and id is always included. |
id / ids | Integer-compatible or native array | No | Exact category-ID filter. id wins when both are supplied. |
name | String or native array | No | Case-insensitive exact name filter or exact lowercased list. |
categoryGroupId / taxRate | Numeric or native array | No | Exact numeric filter(s). The shared detail helper integer-converts scalar and array members, including taxRate, so fractional values lose their decimal part. |
accountID | Integer-compatible | No | Adds an inner join restricting results to categories linked from this account through manymany.type_num=1. |
order | String, object, or native array | No | Mapped ordering by id, name, categoryGroupId, or taxRate. |
advanceSearch | Native array | No | Shared mapped condition objects used by internal CRM2 widgets. |
Example request
$categories = FM_api('AccountCategory_getRequestedDetails', [
'fields' => ['id', 'name', 'taxRate', 'accountIDs', 'nameAndTaxRate'],
'accountID' => 331042,
'order' => ['name'],
]);
Example response
[
{"id":"271006","name":"Standard VAT","taxRate":"20","accountIDs":["331042"],"nameAndTaxRate":"Standard VAT - 20%"}
]
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 row matches. Unknown requested fields are silently omitted. |
Runtime/type error | fields is a JSON string instead of the required 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. - Requesting
nameAndTaxRateappendsnameandtaxRateto the response even when they were not separately requested. - Requesting
accountIDsperforms one additional link query per returned category and returns distinct account IDs. - Duplicate account/category link rows can duplicate the main result when
accountIDis used because the joined query has noDISTINCT.
See it in Fieldmotion
CRM1
No direct CRM1 caller was found; CRM1 uses fixed category-list endpoints.
CRM2
Open Purchase Orders, Quotes, Invoices, Job Types, or a table-invoice widget. Their configured data loaders request the category fields needed for tax selectors and row calculations.
Related endpoints
AccountCategories_getDataTableadds search, filters, paging, and counts.Accounts_getCategoriesreturns the whole fixed-shape catalogue with group names.