# Customer

Look up a customer by its ID.

```graphql
type Query {
  customer(id: ID!): Customer
}
```

## Arguments

- `id` (`ID!`, required)

## Returns

`Customer`: A registered customer.

## Types

```graphql
"A registered customer."
type Customer implements Node {
  id: ID!
  "The customer's full name."
  name: String!
  "The customer's email address."
  email: String @deprecated(reason: "Use `contact` instead.")
  "Contact information of the customer."
  contact: ContactInfo
  "Orders placed by this customer."
  orders(
    "Include only orders with the given status."
    status: OrderStatus
    first: Int = 10
  ): [Order!]!
}
```

## Examples

### Customer Profile

The public profile of a customer.

```graphql
query CustomerProfile($id: ID!) {
  customer(id: $id) {
    id
    name
  }
}
```

Variables:

```json
{
  "id": "cus_42"
}
```

Response:

```json
{
  "data": {
    "customer": {
      "id": "1",
      "name": "string"
    }
  }
}
```

### Customer With Orders

A customer with their contact details and latest orders.

```graphql
query CustomerWithOrders($id: ID!) {
  customer(id: $id) {
    name
    contact {
      email
      phone
    }
    latestOrders: orders(first: 3) {
      ...OrderSummary
    }
  }
}

fragment OrderSummary on Order {
  id
  status
  total
  createdAt
}
```

Variables:

```json
{
  "id": "cus_42"
}
```

Response:

```json
{
  "data": {
    "customer": {
      "name": "string",
      "contact": {
        "email": "string",
        "phone": "string"
      },
      "latestOrders": [
        {
          "id": "1",
          "status": "PENDING",
          "total": 10.5,
          "createdAt": "<DateTime>"
        }
      ]
    }
  }
}
```
