Accounts and tax types
Create a tax-type group
/a/AccountCategoryGroup_new
Create one named group for organising finance tax types.
When to use this endpoint
Use AccountCategoryGroup_new from a Finance-page add-group control before assigning categories to the returned ID.
Authentication and permissions
The request must establish an authenticated tenant context with signed API credentials or a logged-in CRM session. This legacy handler checks for the tenant database prefix rather than calling the normal login guard.
It performs no additional Finance-page, client-admin, role, create, edit, or delete permission check.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Trimmed nonempty group name, maximum 64 bytes. |
description | String | No | Trimmed description; defaults to an empty string. The endpoint applies no application-level length limit. |
Example request
$created = FM_api('AccountCategoryGroup_new', [
'name' => 'Income',
'description' => 'Sales and other income',
]);
Example response
{"ok":1,"id":151003,"name":"Income"}
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: name"} | The name is absent or blank after trimming. |
{"error":"name too long. max 64 chars"} | The trimmed name exceeds 64 bytes. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Duplicate group names are accepted.
- The returned
nameis the trimmed input. The response does not include the description. - Category groups have no creation/edit timestamp columns.
Side effects
- Inserts one tenant
account_category_groupsrow. This route does not explicitly clear the table cache.
See it in Fieldmotion
CRM1
Open Settings → Finance. CRM1 loads and edits the Chart of Accounts, Tax Types, and Tax Groups from this endpoint family; filter browser developer tools for the exact function name. Complete the blank Tax Group row or choose “add new” from the Tax Type dialog.
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. The add-group modal calls this endpoint and inserts the returned ID/name into the current selector.
Related endpoints
AccountCategory_newassigns a new category to the returned group ID.Accounts_getAccountCategoryGroupslists created groups.