When to use this endpoint

Use Customers_getByChild when rendering jobs that may refer to a customer site or an asset and you need the parent customer shown as a second address/context record.

This legacy batch shape is intended for the shared CRM display cache. Use Customers_getById when you already know customer IDs.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.

The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.

Parameters

ParameterTypeRequiredDescription
idsArrayYesNative request array of tokens in <child-id>_<type> form. Type 0 means customer and type 1 means asset. Unlike many batch endpoints, this handler does not JSON-decode a string.

Example request

$parents = FM_api('Customers_getByChild', [
	'ids' => ['1042_0', '5501_1'],
]);

Example response

[
  {
    "child_id": "1042",
    "child_type": "0",
    "obj": {
      "id": "1001",
      "name": "Northwind Group",
      "parent_id": "0",
      "is_active": "1"
    }
  },
  {
    "child_id": "5501",
    "child_type": "1",
    "obj": false
  }
]

A customer child returns a broad fixed parent record. An asset child delegates to Customer_getByChild and normally returns the standard Customer_get record. A child without a resolvable parent returns false.

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":"missing or invalid parameter: ids"}ids is absent. Despite the wording, the handler does not otherwise validate that it is an array.
Malformed or partial responseA token lacks an underscore/type segment, contains unsafe nonnumeric customer-ID text, or ids is supplied as a JSON string.

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

Behaviour and edge cases

  • Customer tokens are grouped and returned before asset tokens, so the result does not necessarily preserve mixed input order. Duplicate tokens produce duplicate result entries.
  • For a customer child, the endpoint reads the child and parent without soft-delete filters. A deleted child can resolve a deleted parent, and inactive records are included.
  • For an asset child, a customer-type asset location takes precedence over its owner. Otherwise the owner is used. The delegated final customer lookup excludes soft-deleted customers.
  • Unknown type numbers are silently ignored and receive no output item.
  • There is no pagination or explicit batch-size limit.

See it in Fieldmotion

CRM1

Open a job display whose customer target is a site or asset and whose layout shows the parent/customer address. The shared customerGetByChild cache batches nearby lookups through Customers_getByChild; filter Network requests by the function name.

CRM2

CRM2 contains the same shared batch-cache helper, but a production call site was not found in the current CRM2 source. No CRM2 screen can therefore be named with confidence.

Related endpoints

  • Customers_getById retrieves explicitly known customer IDs with field selection.
  • Customer_get is used internally for the asset branch’s resolved customer.