> ## Documentation Index
> Fetch the complete documentation index at: https://redo-44af351d-docs-v3-graphql-api-reference.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# customer

> Fetch a single customer by its id (or legacy id), or by email. Provide exactly one.

**Required scopes:**
[`customers_read`](/docs/api-reference/v3/reference/scopes#scope-customers_read)

## Arguments

<ResponseField name="email" type="String">
  The email address of the customer to fetch. Mutually exclusive with `id`.
</ResponseField>

<ResponseField name="id" type="ID">
  The id (or legacy Mongo id) of the customer to fetch. Mutually exclusive with
  `email`.
</ResponseField>

## Returns

<ResponseField name="customer" type={<a href="/docs/api-reference/v3/reference/customers/customer">Customer</a>}>
  A shopper who has interacted with the merchant, with their contact and location
  details.

  <Expandable title="fields" lazyRender>
    <ResponseField name="createdAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
      When the customer record was created.
    </ResponseField>

    <ResponseField name="customFields" type={<a href="/docs/api-reference/v3/reference/common/json">JSON</a>}>
      Merchant-defined custom field values, keyed by each field's name. Null when the customer has no custom fields set.
    </ResponseField>

    <ResponseField name="email" type="String">
      The customer's primary email address.
    </ResponseField>

    <ResponseField name="firstName" type="String">
      The customer's first name.
    </ResponseField>

    <ResponseField name="id" type="ID!" required>
      The id of this customer.
    </ResponseField>

    <ResponseField name="lastName" type="String">
      The customer's last name.
    </ResponseField>

    <ResponseField name="legacyId" type="String!" required>
      The customer's legacy identifier (the source Mongo ObjectId), accepted anywhere an `id` is.
    </ResponseField>

    <ResponseField name="location" type={<a href="/docs/api-reference/v3/reference/customers/customer-location">CustomerLocation</a>}>
      The customer's current location, if known.

      <Expandable title="fields" lazyRender>
        <ResponseField name="city" type="String">
          The city, town, or village.
        </ResponseField>

        <ResponseField name="country" type="String">
          The country name.
        </ResponseField>

        <ResponseField name="countryCode" type="String">
          The country code.
        </ResponseField>

        <ResponseField name="ianaTimeZoneName" type="String">
          The IANA time zone name for the location (e.g. America/New\_York).
        </ResponseField>

        <ResponseField name="latitude" type="Float">
          The latitude of the location, if geocoded.
        </ResponseField>

        <ResponseField name="longitude" type="Float">
          The longitude of the location, if geocoded.
        </ResponseField>

        <ResponseField name="postalCode" type="String">
          The postal or ZIP code.
        </ResponseField>

        <ResponseField name="state" type="String">
          The state, province, or region name.
        </ResponseField>

        <ResponseField name="stateCode" type="String">
          The state, province, or region code.
        </ResponseField>

        <ResponseField name="street1" type="String">
          The first line of the street address.
        </ResponseField>

        <ResponseField name="street2" type="String">
          The second line of the street address.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="phoneNumber" type="String">
      The customer's primary phone number.
    </ResponseField>

    <ResponseField name="updatedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
      When the customer record was last updated.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

```graphql theme={null}
query {
  customer(email: "...", id: "...") {
    createdAt
    customFields
    email
    firstName
    id
    lastName
    legacyId
    phoneNumber
    # ...
  }
}
```
