Accounts and tax types
Set the default nominal account
/a/Account_setDefault
Make one account the tenant’s sole row marked as the default nominal account.
When to use this endpoint
Use Account_setDefault for CRM1’s Chart of Accounts default checkbox. This changes the table marker, not the separate named finance settings.
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 |
|---|---|---|---|
id | Integer-compatible | Yes | Positive account ID to mark as default. |
Example request
$result = FM_api('Account_setDefault', [
'id' => 331042,
]);
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. |
{"error":"account does not exist"} | No account has that ID in the authenticated tenant. The current default is unchanged. |
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 other rows whose marker is nonzero are set to
0; the selected row is then set to1. - This does not update settings such as
default-nominaloracc-default-nominal. Those settings can select accounts independently.
Side effects
- Advances
last_editedon each row whose default marker actually changes and clears the account 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. Select an account’s Default checkbox to send Account_setDefault.
CRM2
The current CRM2 Finance page does not expose this checkbox and sends defaultAccount=false in its snapshot payload.
Related endpoints
Accounts_getDefaultreads a row with this marker.Account_updateDatacan also set the marker during a full-list save.