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

ParameterTypeRequiredDescription
taxGroupsNonempty native array of objectsYesAuthoritative complete group list.
taxGroups[].taxGroupIDInteger-compatibleYesExisting positive ID to retain/update, or 0 for a new group.
taxGroups[].taxGroupNameStringNoTrimmed replacement name. This bulk endpoint does not require a name or enforce the schema’s 64-character limit.
taxGroups[].taxGroupDescriptionStringNoTrimmed 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

ResponseCondition
{"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 their last_edited timestamps, 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