Accounts and tax types
Synchronize all tax-type groups
/a/AccountCategoryGroup_updateData
Synchronize the complete tax-group list to a CRM2 Finance-page snapshot.
When to use this endpoint
Use AccountCategoryGroup_updateData only with every group the tenant should retain. It is the last mutation in CRM2’s Finance Save chain.
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 |
|---|---|---|---|
taxGroups | Nonempty native array of objects | Yes | Authoritative complete group list. |
taxGroups[].taxGroupID | Integer-compatible | Yes | Existing positive ID to retain/update, or 0 for a new group. |
taxGroups[].taxGroupName | String | No | Trimmed replacement name. This bulk endpoint does not require a name or enforce the schema’s 64-character limit. |
taxGroups[].taxGroupDescription | String | No | Trimmed replacement description, defaulting to an empty string. |
Example request
$result = FM_api('AccountCategoryGroup_updateData', [
'taxGroups' => [
[
'taxGroupID' => 151003,
'taxGroupName' => 'Income',
'taxGroupDescription' => 'Sales and other income',
],
],
]);
Example response
{"ok":1}
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. |
{"error":"missing or invalid parameter: tax groups"} | The outer value is absent, not a native array, empty, or contains a non-object/non-array element. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- All deletions occur before new rows are inserted and existing IDs are updated.
- Blank names, duplicate names, and overlong names reach the database without application validation.
- The response contains no created IDs, counts, or per-row warnings.
Side effects
- Sets categories assigned to omitted groups to
category_group_id=0, advances theirlast_editedtimestamps, and clears their cache. - Physically deletes omitted group rows without deletion-log entries.
- Creates or overwrites submitted groups. Category groups have no creation/edit timestamps.
See it in Fieldmotion
CRM1
CRM1 does not call this snapshot route; it creates, saves, and deletes groups individually.
CRM2
Open Settings → Finance. CRM2 loads the three finance tables and saves them as complete snapshots; filter browser developer tools for the exact function name. Save calls this endpoint after the account and category snapshots; only nonblank group rows are submitted by the UI.
Related endpoints
Accounts_getAccountCategoryGroupssupplies the initial complete list.AccountCategory_updateDatasaves category rows immediately before this call.