# Customer A customer profile including name, contact information, order history, and preferences. ## Type Definition ```graphql type Customer { id: Int customerNumber: String name: String address: Address tags: [String] hasAccess: Boolean username: String firstName: String lastName: String language: Locale currency: Currency acceptsMarketing: Boolean consents: [ConsentRecord]! orderCount: Int orderTotal: Float refundCount: Int refundTotal: Float firstOrderDate: String lastOrderDate: String audiences: [String] loyaltyDiscountProgress: LoyaltyDiscountProgress metafields: [Metafield]! metafield: Metafield } ``` ## Fields | Field | Type | Description | |-------|------|-------------| | id | Int | Unique identifier for the customer. | | customerNumber | String | The customer number assigned to this customer. | | name | String | The full name of the customer. | | address | [Address](/reference/storefront/1.3.0/objects/address) | The customer's address information. | | tags | [String] | The tags associated with the customer. | | hasAccess | Boolean | Indicates if the customer has access rights to the store. | | username | String | The username of the customer. | | firstName | String | The first name of the customer. | | lastName | String | The last name of the customer. | | language | [Locale](/reference/storefront/1.3.0/objects/locale) | The customer's language/locale information. | | currency | [Currency](/reference/storefront/1.3.0/objects/currency) | The customer's preferred currency. | | acceptsMarketing | Boolean | Indicates if the customer has accepted marketing communications. | | consents | [[ConsentRecord](/reference/storefront/1.3.0/objects/consent-record)]! | Recorded customer consents, newest first. | | orderCount | Int | The total number of orders placed by the customer. | | orderTotal | Float | The total amount spent by the customer on orders. | | refundCount | Int | The total number of refunds issued to the customer. | | refundTotal | Float | The total amount refunded to the customer. | | firstOrderDate | String | The date and time of the customer's first order, in RFC 2822 format. | | lastOrderDate | String | The date and time of the customer's most recent order, in RFC 2822 format. | | audiences | [String] | The names of the audiences or segments the customer belongs to. | | loyaltyDiscountProgress | [LoyaltyDiscountProgress](/reference/storefront/1.3.0/objects/loyalty-discount-progress) | Returns the progress of the customer towards the next loyalty discount in a GraphQL compatible format. | | metafields | [[Metafield](/reference/storefront/1.3.0/objects/metafield)]! | Metafields stored on this resource. | | metafield | [Metafield](/reference/storefront/1.3.0/objects/metafield) | A single metafield by namespace and key. | ## Relationships The `Customer` type represents a customer profile and contains references to several related types. The `address` field links to address information, while `language` and `currency` fields define the customer's preferences. The `consents` field maintains an array of consent records in chronological order. Loyalty and discount information is provided through the `loyaltyDiscountProgress` field. The `metafields` and `metafield` fields allow access to custom metadata associated with the customer. This type is used across multiple parts of the API including orders, reviews, comments, and cart operations. ## Example ```graphql query { customer(id: 12345) { id customerNumber name firstName lastName email orderCount orderTotal acceptsMarketing address { street city country } language { code } currency { code } consents { type status } metafields { namespace key value } } } ``` ## Implements None ## Related Types - [Address](/reference/storefront/1.3.0/objects/address) - [Locale](/reference/storefront/1.3.0/objects/locale) - [Currency](/reference/storefront/1.3.0/objects/currency) - [ConsentRecord](/reference/storefront/1.3.0/objects/consent-record) - [LoyaltyDiscountProgress](/reference/storefront/1.3.0/objects/loyalty-discount-progress) - [Metafield](/reference/storefront/1.3.0/objects/metafield)