> ## Documentation Index
> Fetch the complete documentation index at: https://plain-mattvagni-patch-1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch customers

We provide a number of methods for fetching customers:

1. [Get customers](#get-customers) (To fetch more than one customer at a time)
2. [Get customer by ID](#get-customer-by-id)
3. [Get customer by email](#get-customer-by-email)

All of these endpoints require the following permissions:

* `customer:read`

## Get customers

Our API allows you to fetch customers as a collection using `getCustomers` in our SDKs or the `customers` query in GraphQL. In both cases this endpoint supports [Pagination](/api-reference/graphql/pagination).

This is a very flexible endpoint which supports a variety of options for filtering and sorting, for full details try our [API explorer](https://app.plain.com/developer/api-explorer/) or [Typescript SDK](https://github.com/team-plain/typescript-sdk/).

<Tabs items={[ 'Typescript SDK', 'GraphQL']}>
  <Tab title="Typescript SDK">
    <Snippet file="typescript-sdk/get-customers.mdx" />
  </Tab>

  <Tab title="GraphQL">
    <Snippet file="graphql/get-customers.mdx" />
  </Tab>
</Tabs>

## Get customer by ID

If you already have the ID of a customer from within Plain or one of our other endpoints you can fetch more details about them using `getCustomerById` in our SDKs or the `customer` query in GraphQL.

<Tabs>
  <Tab title="Typescript SDK">
    <Snippet file="typescript-sdk/get-customer-by-id.mdx" />
  </Tab>

  <Tab title="GraphQL">
    <Snippet file="graphql/get-customer-by-id.mdx" />
  </Tab>
</Tabs>

## Get customer by email

To fetch a customer by email you can use `getCustomerByEmail` in our SDKs or the `customerByEmail` query in GraphQL.

<Tabs>
  <Tab title="Typescript SDK">
    <Snippet file="typescript-sdk/get-customer-by-email.mdx" />
  </Tab>

  <Tab title="GraphQL">
    <Snippet file="graphql/get-customer-by-email.mdx" />
  </Tab>
</Tabs>
