# customers

Query · GraphQL API

A paginated list of customers that match the CustomerSearchInput.

## Authentication

- SERVER

## Input

- `input` (`CustomerSearchInput!`) — required
- `first` (`Int`)
- `after` (`String`)

## Returns [CustomerConnection](/braintree/graphql/reference/types/customer-connection)

A paginated list of customers.

### Returned fields

- `edges` (`[CustomerConnectionEdge]`): A list of customers.
- `pageInfo` (`PageInfo!`) — non-null: Information about the page of customers contained in `edges`.

## Examples

### Search customers

A paginated list of customers that match the CustomerSearchInput.

```graphql
query searchCustomers($input: CustomerSearchInput!, $first: Int, $after: String, $paymentMethodsFirst: Int, $paymentMethodsAfter: String, $transactionsFirst: Int, $transactionsAfter: String)  {
  customers(input: $input, first: $first, after: $after) {
    edges {
      cursor
      node {
        __typename
        id
        legacyId
        company
        createdAt
        customFields {
          name
          value
        }
        defaultPaymentMethod {
          __typename
          id
          legacyId
        }
        email
        firstName
        lastName
        phoneNumber
        fax
        website
        paymentMethods(first: $paymentMethodsFirst, after: $paymentMethodsAfter) {
          edges {
            cursor
            node {
              __typename
              id
              legacyId
            }
          }
          pageInfo {
            hasNextPage
            hasPreviousPage
            startCursor
            endCursor
          }
        }
        transactions(first: $transactionsFirst, after: $transactionsAfter) {
          edges {
            cursor
            node {
              __typename
              id
              legacyId
            }
          }
          pageInfo {
            hasNextPage
            hasPreviousPage
            startCursor
            endCursor
          }
        }
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

---

[View the complete GraphQL schema on GitHub](https://raw.githubusercontent.com/braintree/graphql-api/refs/heads/master/schema.graphql)