Marketing
Query mapped marketing-expense details
/a/MarketingExpense_getRequestedDetails
Read selected mapped marketing-expense fields by ID or exact filters without pagination.
When to use this endpoint
Use MarketingExpense_getRequestedDetails for a known expense row, a bounded ID batch, or exact mapped filters. Use the data-table endpoint for paged search.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler requires login but performs no additional Marketing-page, create, edit, delete, or role-permission check.
All reads and writes use the authenticated tenant’s tables. CRM1 and CRM2 hide some controls through client-side permissions; these routes do not repeat those UI checks.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fields | Native array | No | Fields to return; omission requests id, source, expense, expenseDate, createDate, and lastEdited. |
id or ids | Integer-compatible or native array | No | Expense-row IDs. id takes precedence. |
source | Integer-compatible or native array | No | Exact source ID(s). |
expense | Numeric-compatible or native array | No | Exact numeric expense match. The shared reader integer-converts non-string numeric filter types, so fractional scalar filters are truncated and should not be used to locate a decimal expense. |
expenseDate | String or native array | No | Case-insensitive exact date string match. |
createDate, lastEdited | Integer-compatible or native array | No | Exact stored Unix timestamp filters. |
order | Mapped field, object, or native array | No | Optional mapped ordering, for example {"id":"expenseDate","dir":"desc"}. |
Example request
$rows = FM_api('MarketingExpense_getRequestedDetails', [
'id' => '7124',
'fields' => ['id', 'source', 'expense', 'expenseDate', 'createDate'],
]);
Example response
[
{"id":"7124","source":"30124","expense":"425.5","expenseDate":"2026-10-01","createDate":"2026-10-01 15:20:00"}
]
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. |
[] | No row matches all filters. |
Runtime/type error | fields is supplied as JSON text instead of a native array. |
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 response returns
sourceas its numeric ID, not a source-name object. createDateandlastEditedare formatted datetimes;expenseDateremains a date.- There is no pagination, default order, active state, or deleted state.
- Unknown requested fields are omitted and
idis always added.
See it in Fieldmotion
CRM1
No direct CRM1 production caller was found; CRM1 edits the positional table values directly.
CRM2
The generic Marketing Expenses display derives this route for detail/view operations.
Related endpoints
MarketingExpenses_getDataTablesupports paged UI filtering.MarketingSources_listresolves thesourceID.