Sales & CRMQu Query

getCustomerBy

Topics: Commerce

Fetch a customer by external ID. Requires customer:read permission.

Returns

CustomerState

Arguments

External system identifier

Examples

Find Customer

query FindCustomer($externalId: String!) {
  getCustomerBy(externalId: $externalId) {
    id
    externalId
    name
    email
    isActive
  }
}

Variables

{
  "externalId": "CRM-1042"
}

Example response

{
  "data": {
    "getCustomerBy": {
      "id": "cus_01h455vb4pex5vsknk084sn02q",
      "externalId": "CRM-1042",
      "name": "Northstar Packaging",
      "email": "orders@northstar.example",
      "isActive": true
    }
  }
}
Exact field SDL
"""Fetch a customer by external ID. Requires customer:read permission."""
getCustomerBy(
  """External system identifier"""
  externalId: String
): CustomerState @topic(names: ["commerce"]) @topic_example(names: ["crm.find-customer"])

Declared on Query. Access is checked by the platform for each operation.