# Customer - storefront - OBJECT
Version: 2025-01

## Description
A customer represents a customer account with the shop. Customer accounts store contact information for the customer, saving logged-in customers the trouble of having to provide it at every checkout.

### Access Scopes
`unauthenticated_read_customers` access scope.


## Fields
* [acceptsMarketing](/docs/api/storefront/2025-01/scalars/Boolean): Boolean! - Indicates whether the customer has consented to be sent marketing material via email.
* [createdAt](/docs/api/storefront/2025-01/scalars/DateTime): DateTime! - The date and time when the customer was created.
* [defaultAddress](/docs/api/storefront/2025-01/objects/MailingAddress): MailingAddress - The customer’s default address.
* [displayName](/docs/api/storefront/2025-01/scalars/String): String! - The customer’s name, email or phone number.
* [email](/docs/api/storefront/2025-01/scalars/String): String - The customer’s email address.
* [firstName](/docs/api/storefront/2025-01/scalars/String): String - The customer’s first name.
* [id](/docs/api/storefront/2025-01/scalars/ID): ID! - A unique ID for the customer.
* [lastName](/docs/api/storefront/2025-01/scalars/String): String - The customer’s last name.
* [metafield](/docs/api/storefront/2025-01/objects/Metafield): Metafield - A [custom field](https://shopify.dev/docs/apps/build/custom-data), including its `namespace` and `key`, that's associated with a Shopify resource for the purposes of adding and storing additional information.
* [metafields](/docs/api/storefront/2025-01/objects/Metafield): Metafield! - A list of [custom fields](/docs/apps/build/custom-data) that a merchant associates with a Shopify resource.
* [numberOfOrders](/docs/api/storefront/2025-01/scalars/UnsignedInt64): UnsignedInt64! - The number of orders that the customer has made at the store in their lifetime.
* [phone](/docs/api/storefront/2025-01/scalars/String): String - The customer’s phone number.
* [tags](/docs/api/storefront/2025-01/scalars/String): String! - A comma separated list of tags that have been added to the customer.
Additional access scope required: unauthenticated_read_customer_tags.

* [updatedAt](/docs/api/storefront/2025-01/scalars/DateTime): DateTime! - The date and time when the customer information was updated.

## Connections
* [addresses](/docs/api/storefront/2025-01/connections/MailingAddressConnection): MailingAddressConnection!
* [orders](/docs/api/storefront/2025-01/connections/OrderConnection): OrderConnection!



## Related queries
* [customer](/docs/api/storefront/2025-01/queries/customer) The customer associated with the given access token. Tokens are obtained by using the
[`customerAccessTokenCreate` mutation](https://shopify.dev/docs/api/storefront/latest/mutations/customerAccessTokenCreate).


## Related mutations
* [customerActivateByUrl](/docs/api/storefront/2025-01/mutations/customerActivateByUrl) Activates a customer with the activation url received from `customerCreate`.
* [customerActivate](/docs/api/storefront/2025-01/mutations/customerActivate) Activates a customer.
* [customerCreate](/docs/api/storefront/2025-01/mutations/customerCreate) Creates a new customer.
* [customerDefaultAddressUpdate](/docs/api/storefront/2025-01/mutations/customerDefaultAddressUpdate) Updates the default address of an existing customer.
* [customerResetByUrl](/docs/api/storefront/2025-01/mutations/customerResetByUrl) "Resets a customer’s password with the reset password URL received from a reset password email. You can send a reset password email with the [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation."

* [customerReset](/docs/api/storefront/2025-01/mutations/customerReset) "Resets a customer’s password with the token received from a reset password email. You can send a reset password email with the [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation."

* [customerUpdate](/docs/api/storefront/2025-01/mutations/customerUpdate) Updates an existing customer.

## Related Unions
* [MetafieldParentResource](/docs/api/storefront/2025-01/unions/MetafieldParentResource) A resource that the metafield belongs to.

## Examples
### Get a customer by access token
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \\\n-d '{\n\"query\": \"query { customer(customerAccessToken: \\\"bobs_token\\\") { id firstName lastName acceptsMarketing email phone } }\"\n}'\n"
Node example: "const client = new shopify.clients.Storefront({\n  domain: 'your-development-store.myshopify.com',\n  storefrontAccessToken,\n});\nconst data = await client.query({\n  data: `query {\n    customer(customerAccessToken: \"bobs_token\") {\n      id\n      firstName\n      lastName\n      acceptsMarketing\n      email\n      phone\n    }\n  }`,\n});\n"
Ruby example: null 
Remix example: "const { storefront } = await unauthenticated.storefront(\n  'your-development-store.myshopify.com'\n);\n\nconst response = await storefront.graphql(\n  `#graphql\n  query {\n    customer(customerAccessToken: \"bobs_token\") {\n      id\n      firstName\n      lastName\n      acceptsMarketing\n      email\n      phone\n    }\n  }`,\n);\n\nconst data = await response.json();\n"
Graphql query: "query {\n  customer(customerAccessToken: \"bobs_token\") {\n    id\n    firstName\n    lastName\n    acceptsMarketing\n    email\n    phone\n  }\n}"
#### Graphql Input
null
#### Graphql Response
{
  "data": {
    "customer": {
      "id": "gid://shopify/Customer/410535040",
      "firstName": "John",
      "lastName": "Smith",
      "acceptsMarketing": false,
      "email": "johnsmith@example.com",
      "phone": "+16134504533"
    }
  }
}