When to use this endpoint

Use Customer_getLocations when the integration needs rows from the tenant locations table, not the customer record’s own address and coordinates.

The endpoint is a small legacy projection; it does not expose location metadata or provide search and pagination controls.

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
idInteger stringYesCustomer ID matched against location rows with customer_type=1. The endpoint does not first verify that the customer exists.

Example request

$locations = FM_api('Customer_getLocations', [
	'id' => '1042',
]);

Example response

[
  {
    "id": "77",
    "name": "Belfast depot",
    "lat": "54.5973",
    "lng": "-5.9301",
    "address": "14 Harbour Road, Belfast"
  }
]

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: id"}id is absent or does not convert to a positive integer.
[]No location rows match, including when the customer ID does not exist.

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 fixed response fields are id, name, lat, lng, and address. Database scalar values normally serialize as strings.
  • Rows are restricted to customer_type=1 and the supplied customer_id.
  • There is no explicit ordering, pagination, activity filter, or customer visibility filter.

See it in Fieldmotion

CRM1

No production CRM1 caller was found; direct API tests cover the projection and empty result.

CRM2

No production CRM2 caller was found. CRM2 location selectors use their own mapped list APIs.

Related endpoints