# customer - storefront - QUERY Version: 2025-01 ## Description 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). ### Access Scopes ## Arguments * [customerAccessToken](/docs/api/storefront/2025-01/scalars/String): String! - The customer access token. ## Returns * [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. ## 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" } } }