Accounts and tax types
Retrieve the default nominal account
/a/Accounts_getDefault
Retrieve an account row whose legacy default marker is enabled.
When to use this endpoint
Use Accounts_getDefault only for workflows that still honour accounts.is_default, such as CRM1 Requisition Orders. Many newer workflows use named settings instead.
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
This endpoint has no operation-specific parameters.
Example request
$account = FM_api('Accounts_getDefault');
Example response
{"id":"331042","nominal_code":"4000","name":"Sales","display_name":"Sales"}
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. |
false | No row has is_default=1. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- The query has no
ORDER BYorLIMIT. If legacy data contains more than one default row, which onefmdbRow()returns is unspecified. - The response omits the
is_defaultfield itself. - This marker is separate from settings such as
default-nominalandacc-default-nominal.
See it in Fieldmotion
CRM1
Open or edit a Requisition Order. CRM1 calls Accounts_getDefault while choosing default nominal/tax values.
CRM2
No direct CRM2 caller was found. CRM2 finance and document editors generally load Accounts_list plus named settings.
Related endpoints
Account_setDefaultchanges this marker.Accounts_listincludesis_defaultfor every account.