Forms
Read a form’s invoiceable flag
/a/Form_getIsInvoiceable
Resolve the stored invoiceable flag directly or through a job’s form.
When to use this endpoint
Use before rendering invoice-related controls. This is a form flag, not a complete determination of contract, finance or object permissions.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session and is scoped to the authenticated tenant.
The handler performs no form, department, owner, or page-permission check unless the page below says otherwise. CRM navigation may impose additional UI-only access rules.
Outsourced IDs require an active incoming user_links relationship from the source tenant to the authenticated tenant; the read is explicitly routed to that source. Job fallback enforces the actor’s existing Job scope.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-compatible ID or outsourced token | No | Explicit non-null id takes precedence, including zero or blank. Local values integer-convert. Legacy outsourced syntax o<sourceTenantId>i<formId> requires positive source/form IDs, an active source link and explicit source-tenant routing. |
job_id / app_id | Integer-compatible job ID | When id absent | job_id takes precedence when non-null. Resolves form_id from a non-deleted job. No job row or zero form ID becomes a missing form lookup rather than a distinct job error. |
Example request
$flag = FM_api('Form_getIsInvoiceable', ['job_id'=>'1088']);
Example response
"1"
Success is a bare database scalar, commonly string 0/1 (or another stored numeric value). Missing form returns false, not a not-found object. Convert the value numerically; the string 0 and a missing row have different wire representations.
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"} | No explicit id and neither fallback resolves to a nonzero integer job selector. |
{"error":"you do not have access to that outsourcer"} | No active link from the supplied source tenant. |
{"error":"Unable to read form flag"} | A source-link, form or fallback-job query fails; query failure is not reported as a disabled flag. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- No form archive/type/page/owner filter. A job fallback checks existing Job scope and excludes deleted jobs; an explicit form read is still a definition lookup, not proof of job access.
- Outsourced IDs require positive source/form components and an active incoming link, then read using the source tenant’s explicit routing ID. Unlinked or malformed tokens return an error; same-host placement is not an authorization bypass.
- No normalization to boolean: an out-of-range stored value is returned as-is. No paging, side effects or timestamp refresh.
- No direct mobile app/m-service caller for this RPC was found. Mobile form definitions arrive through m’s syncDownloads form channel, not this endpoint.
Side effects
- Read-only; no history, cache invalidation, file write, URL fetch or report rendering.
See it in Fieldmotion
CRM1
Job Files and Internal Notes use job_id; the invoice-table widget uses form id with app_id fallback. Inspect Form_getIsInvoiceable while opening those views.
CRM2
The invoice-table widget calls Form_getIsInvoiceable with id=form_id and app_id=job ID. No dedicated flag write is invoked by that lookup.
Related endpoints
Form_setIsInvoiceablesets the local flag.Forms_getByIdprovides checked linked-tenant form retrieval.