{"id":755,"date":"2023-01-02T21:08:14","date_gmt":"2023-01-02T21:08:14","guid":{"rendered":"https:\/\/www.webshouters.com\/blog\/?p=755"},"modified":"2023-10-05T06:48:53","modified_gmt":"2023-10-05T06:48:53","slug":"get-customer-details-using-graphql-in-magento-2","status":"publish","type":"post","link":"https:\/\/www.webshouters.com\/blog\/get-customer-details-using-graphql-in-magento-2\/","title":{"rendered":"How to Get Customer Info using GraphQL in Magento 2?"},"content":{"rendered":"\n<p>To retrieve customer information in Magento 2 using GraphQL, you can run the following query:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">query {\n  customer {\n    email\n    firstname\n    lastname\n    addresses {\n      firstname\n      lastname\n      street\n      city\n      region {\n        region_code\n        region\n      }\n      postcode\n      country {\n        code\n        label\n      }\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<p>This query will return the customer&#8217;s email, first name, last name, and a list of addresses associated with the customer, including the first name, last name, street, city, region (code and name), postcode, and country (code and label) for each address.<\/p>\n\n\n\n<p><strong>Note:-<\/strong> You will need to include an authentication token in the request header in order to access the customer information.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To retrieve customer information in Magento 2 using GraphQL, you can run the following query: This query will return the&#8230;<\/p>\n","protected":false},"author":3,"featured_media":869,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,18,28,2,13],"tags":[30,11],"class_list":["post-755","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-ecommerce","category-magento","category-magento-2-tutorials","category-tips-tricks","tag-development","tag-magento-2"],"jetpack_featured_media_url":"https:\/\/www.webshouters.com\/blog\/wp-content\/uploads\/2023\/01\/Magento2.png","_links":{"self":[{"href":"https:\/\/www.webshouters.com\/blog\/wp-json\/wp\/v2\/posts\/755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webshouters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webshouters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webshouters.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webshouters.com\/blog\/wp-json\/wp\/v2\/comments?post=755"}],"version-history":[{"count":4,"href":"https:\/\/www.webshouters.com\/blog\/wp-json\/wp\/v2\/posts\/755\/revisions"}],"predecessor-version":[{"id":759,"href":"https:\/\/www.webshouters.com\/blog\/wp-json\/wp\/v2\/posts\/755\/revisions\/759"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webshouters.com\/blog\/wp-json\/wp\/v2\/media\/869"}],"wp:attachment":[{"href":"https:\/\/www.webshouters.com\/blog\/wp-json\/wp\/v2\/media?parent=755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webshouters.com\/blog\/wp-json\/wp\/v2\/categories?post=755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webshouters.com\/blog\/wp-json\/wp\/v2\/tags?post=755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}