Jobs: lookups and details
Resolve a job’s default tax settings
/a/Job_getDefaultTaxSettings
Resolve the nominal code and tax defaults used when constructing job quote/invoice lines.
When to use this endpoint
Resolve the nominal code and tax defaults used when constructing job quote/invoice lines.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. These calls use the authenticated account’s data; the handler has no additional job-page, department, assignee or client-admin permission check unless stated below.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Job ID, converted with intval; the result must be positive. This selects a physical job ID, not an app ID or job reference. |
Example request
$result = FM_api('Job_getDefaultTaxSettings', ['id' => '1042']);
Example response
{"source":"customer","nominal":"4000","tax_type":"Standard","tax_rate":20}
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"} | Invalid ID; checked before login. |
{"error":"job does not exist"} | No active job matches. |
{"error":"configured customer tax category does not exist"} | Customer defaults refer to a missing tax-category row. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Precedence is job-type settings, then a direct customer’s saved defaults, then account settings. Job-type overrides require truthy misc_nominal and misc_taxtype; misc_taxrate is returned without numeric normalization.
- Customer defaults apply only when customer_type is 0. default_nominal must be nonblank/nonzero and default_taxcode positive. The saved nominal account ID is resolved to nominal_code; the tax category supplies name and a floating-point tax_rate. A missing nominal account can yield false rather than an error.
- Global fallback reads acc-default-nominal and acc-default-taxtype; tax_rate is looked up by category name and may be a database string or false. source is exactly job type, customer or global, so scalar types vary by branch.
- There is no inheritance from an asset owner or parent customer in this handler. Related type/customer/account/category lookups do not add active/deleted filters. No recalculation or persistence occurs.
See it in Fieldmotion
CRM1
Open job Costs or the invoice-line editor. pageJobCosts.js, widgetStock.js and widgetInvoiceTable.js request Job_getDefaultTaxSettings before constructing rows.
CRM2
Open the job invoice table. widgetInvoiceTable.js calls Job_getDefaultTaxSettings; inspect source and tax_rate before assuming they came from the account defaults.
Related endpoints
Job_getTaxSettingsBasedOnJobTypereturns only the raw job-type configuration, without customer/global fallback.Job_invoiceGetreads already-saved invoice rows rather than applying these defaults to an invoice.