Accounts and tax types
Permanently delete a tax type
/a/AccountCategory_delete
Permanently delete one tax type and detach it from every linked account.
When to use this endpoint
Use AccountCategory_delete for CRM1’s single Tax Type delete action. It is a permanent compatibility operation, not a soft archive.
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 |
|---|---|---|---|
id | Integer-compatible | Yes | Positive category ID. |
Example request
$result = FM_api('AccountCategory_delete', [
'id' => 271006,
]);
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: id"} | The ID is absent or not positive. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- An unknown positive ID still returns success and still creates a deletion-log entry.
- The endpoint records linked account IDs before deleting links so their edit timestamps can be advanced.
Side effects
- Deletes the category and all
manymany.type_num=1rows where it isto_id. - Advances
last_editedon every previously linked account. - Writes an app-sync deletion row under the legacy object key
tax_rate, with user ID0.
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. Delete a Tax Type row to send AccountCategory_delete.
CRM2
CRM2 does not call the single-row delete route. Its Finance Save sends the complete remaining category list to AccountCategory_updateData.
Related endpoints
AccountCategory_updateDatais CRM2’s full-list save.Accounts_getCategorieslists remaining categories.