When to use this endpoint

Use the CRM2 export pipeline after its mapped table provides active scoped IDs. This endpoint itself filters active/scope again; it has no _ids=1 discovery sentinel.

Authentication and permissions

Authenticate with signed API-key fields or a logged-in CRM session. Session requests use dispatcher CSRF protection when configured. API keys use their owner’s identity.

The dispatcher requires explicit View on Requisition Order or Requisition Orders, even without a TeamAccess policy. API keys retain their owner’s permissions. Records are filtered to active headers within RequisitionOrder_scopeSQL: configured TeamAccess, or the legacy department boundary, including the owner exception for unlinked requisitions in the TeamAccess policy.

Parameters

ParameterTypeRequiredDescription
_idsNonempty JSON array stringYesPositive integer requisition header IDs, validated after JSON decoding. []/non-array fail; native arrays are not decoded.
fieldsNonempty JSON string arrayYesSupported field names: id, user_id, description, target_id, target_type, status, cdate, delivery_date, last_edited, approved_by, total_net, total_tax, po_ids, notes, attention, instructions. Request positions become f0,f1,…, plus the unconditional ro_id. Native arrays are not decoded; supply a valid string list before relying on the error contract.

Example request

$rows = FM_api('RequisitionOrders_getExportData', [
	'_ids'=>json_encode(['312']),
	'fields'=>json_encode(['id','user_id','status','target_id']),
]);

Example response

[
  {
    "ro_id": "312",
    "f0": "312",
    "f1": "Example user",
    "f2": "Approved",
    "f3": "Example customer",
    "f4": "Customer"
  }
]

The example requests target_id without target_type, so the implementation appends f4 for the type label.

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.
{"error": "permission denied"}Requisition View is denied.
{"error": "missing or invalid parameter: _ids"}Selection key is absent.
{"error": "_ids should be a JSON array of numbers"}Selection does not decode to a nonempty array.
{"error": "fields should be an array of requested field names"}A decoded array is empty; other malformed types can fail earlier.
{"error": "unknown field name: unsupported"}A non-custom name is outside the export map.
{"error":"permission denied"}The required page permission is missing. Hidden/deleted records are omitted from collections; explicit parent readers reject an inaccessible parent.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Returns a bare array of active visible headers, with no paging, counts, batch cap or guaranteed request-ID ordering. Missing/hidden/deleted IDs are omitted rather than represented by null placeholders.
  • ro_id always holds the local header ID. f-position keys follow fields order. Selecting target_id automatically appends target_type if omitted, producing an extra f column beyond the supplied list.
  • user_id and approved_by resolve authorized user names; status resolves its label. target_id resolves an authorized Contract/Customer/Department/Location name or #ID for Quote/Job/fallback types. No-link zero can still display #0. target_type becomes its label.
  • Other fields retain stored values/types. total_net/total_tax are line-only aggregates; carriage fields are not in this export map. po_ids remains encoded text. Duplicate names keep multiple f columns with the same label transformation in every occurrence.
  • Unknown/custom-table fields return errors before querying; related display names require View and record visibility.
  • fields must be a nonempty JSON string list of field names. Malformed/missing projections fail with a structured JSON error before in_array or SQL.

Side effects

  • Reads tenant data without modifying orders, lines, stock, approval, history or notifications.

See it in Fieldmotion

CRM1

No direct CRM1 literal caller was found in the searched client source. CRM1 uses RequisitionOrders_export.

CRM2

In CRM2 Requisition Orders, choose/configure an export map. The page gathers visible IDs from the unpaged mapped table, and widgetExportCRM2 sends _ids/fields JSON strings in batches before building the CSV client-side.

Related endpoints