Invoices
Retrieve selected invoice details
POST
/a/Invoice_getRequestedDetails
Retrieve selected mapped fields for one or more active invoices without assembling the full edit layout.
When to use this endpoint
Use this for pickers, integration setup, and widgets that need a controlled subset of invoice fields.
Authentication and permissions
The request must use a logged-in CRM session or valid signed API credentials and is scoped to that tenant.
Users whose legacy crm_access mask contains bit 64 receive {"error":"no permission to access api"}. No record-owner check is made.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id / ids | Integer / array | No | Select one invoice or a set of invoice IDs. Without either selector, every active invoice matching other mapped filters can be returned. |
fields | Array | No | Names from the invoice field map; omission defaults to every mapped field. rowsData is loaded from either line-item storage format; quoteIDs adds a quotes array of linked quote IDs. |
Mapped field filters | Mixed | No | Any supplied mapped field is also an exact filter: text is case-insensitive and trimmed, while numeric fields are integer-normalized. |
Example request
$rows = FM_api('Invoice_getRequestedDetails', [
'ids' => [981, 982],
'fields' => ['id', 'num', 'status'],
]);
Example response
[
{"id": 981, "num": "INV-981", "status": 1}
]
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. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Results are unpaginated arrays and do not include placeholders for missing/deleted IDs. Unknown names in
fieldsare silently omitted rather than rejected. - Nominal header fields are normalized into their canonical picker shape. Quote lookup includes direct and ancillary invoice job links, and excludes deleted invoices.
See it in Fieldmotion
CRM1
No direct production CRM1 caller was found for this route.
CRM2
The Send Email widget, Credit Notes allocation flow, and Xero finance settings request selected invoice details.
Related endpoints
Invoices_getDataTablesupplies paginated CRM2 invoice rows and IDs.Invoices_getDTis the CRM1 invoice-list counterpart.