Quotes: queries, documents and delivery
Read selected mapped quote details
/a/Quote_getRequestedDetails
Fetch selected CRM2 fields and optional linked Jobs, invoices and recurrence markers.
When to use this endpoint
Use for CRM2 detail widgets. Request jobIDs explicitly for relation enrichment; use Quote_get for a raw database row.
Authentication and permissions
Authenticate with signed API-key fields or a CRM session. Requires Quotes View (pageQuotes_view); non-admin users blocked by legacy crm_access bit 32 are denied. Client administrators inherit page permissions.
Quote visibility follows the account’s department/account-manager customer filters for non-admin users, including signed keys. Export routes additionally require pageMain_exportTableData. Linked Jobs require Jobs View and their TeamAccess scope; invoice enrichment requires Invoices View and the legacy invoice access check.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id / ids | Scalar ID or native array of IDs | ID or customer selector | Positive scalar/native ID list. Missing, null, empty or malformed selectors fail unless a positive customerID/customer picker filter is supplied. id takes precedence. |
fields | Native array of mapped names | No | Omitted defaults to all mapped fields plus recurringID. Unknown names are ignored and id is always included. Do not JSON-encode this array. |
Mapped field filters | Mapped scalar, array or picker object | No | Top-level mapped aliases filter by equality/in-list; text is trimmed/case-folded. Numeric scalar filters integer-convert, including decimal fields in this detail helper. Picker aliases such as customer accept an object containing id. |
order | Native array of mapped names or {id,dir} objects | No | Mapped order only; desc is recognized explicitly. No default order, page size or ID-input-order guarantee. |
advanceSearch | Native array of CRM filter rows | No | Shared advanced filter input; use mapped field conditions only. Raw SQL filter controls are legacy internals and must not be accepted from untrusted callers. |
Example request
$rows = FM_api('Quote_getRequestedDetails', [
'id'=>['1042'],
'fields'=>['id','quoteNum','customer','jobIDs'],
]);
Example response
[{"id":"1042","quoteNum":"QT-1042","customer":{"id":"1088"},"hasJobs":"0","jobIDs":[],"invoices":[],"customerID":"1088"}]
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":"permission denied"} | Required Quotes/Export permission is absent or legacy access restrictions apply. |
{"error":"missing or invalid parameter: id"} | A positive explicit ID list or supported positive customer selector is required. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Requires a positive explicit id/ids selector, or a positive customerID/customer picker filter used by the Invoice quote chooser. Missing, null, malformed and empty selectors fail rather than widening the read.
- fields is an optional native list of mapped names; omitted selects the map. Unknown names are ignored; id is included. Picker backing fields may also remain in the response. Top-level JSON columns remain encoded strings/null, while nested metadata aliases are extracted.
- Order and advanced conditions are validated before DataProcessClass. Raw SQL filters, invalid directions, malformed pickers and grouping are rejected. quote_ prefixes on advanced mapped fields are normalized.
- Requesting jobIDs adds hasJobs and invoices. Current distinct active, permitted Jobs are returned in creation-date/ID order as quote_id/jobID/jobStatus objects, independent of stale has_jobs cache values. hasJobs is an integer count of these returned Jobs; this read does not repair stored cache.
- Invoices combine active direct quote links with active permitted Job link types 3/4. Exact duplicates are suppressed; invoice access is required before returning enrichment.
- recurringID remains response-only: 0 when disabled/unmatched, otherwise the active source/generated rule ID. This does not expose a writable alias. No pagination or hard cap; selectors keep the read bounded to requested IDs/customer.
- No direct caller for this endpoint was found in the mobile app or its m-service intermediary.
Side effects
- Reads active permitted records without quote cost, history, email or derived Job-cache writes.
See it in Fieldmotion
CRM1
No direct CRM1 caller found; legacy Notes/Fields uses Quote_get.
CRM2
Quote costing/email widgets, Job editors and Invoice quote pickers call Quote_getRequestedDetails. Filter Network for that function; inspect native fields and id parameters.
Related endpoints
Quote_getLayoutDetailsbuilds costing/form widget payloads.Quote_countLinkedJobsrefreshes the active linked-Job count.