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

ParameterTypeRequiredDescription
idInteger-compatibleYesPositive account ID to mark as default.

Example request

$result = FM_api('Account_setDefault', [
	'id' => 331042,
]);

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: 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 to 1.
  • This does not update settings such as default-nominal or acc-default-nominal. Those settings can select accounts independently.

Side effects

  • Advances last_edited on 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