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

ParameterTypeRequiredDescription
fieldsNative arrayNoFields to return; omission requests id, source, expense, expenseDate, createDate, and lastEdited.
id or idsInteger-compatible or native arrayNoExpense-row IDs. id takes precedence.
sourceInteger-compatible or native arrayNoExact source ID(s).
expenseNumeric-compatible or native arrayNoExact 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.
expenseDateString or native arrayNoCase-insensitive exact date string match.
createDate, lastEditedInteger-compatible or native arrayNoExact stored Unix timestamp filters.
orderMapped field, object, or native arrayNoOptional 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

ResponseCondition
{"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 errorfields 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 source as its numeric ID, not a source-name object.
  • createDate and lastEdited are formatted datetimes; expenseDate remains a date.
  • There is no pagination, default order, active state, or deleted state.
  • Unknown requested fields are omitted and id is 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