Skip to Content

Customer

A customer profile including name, contact information, order history, and preferences.

Type Definition

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

FieldTypeDescription
idIntUnique identifier for the customer.
customerNumberStringThe customer number assigned to this customer.
nameStringThe full name of the customer.
addressAddressThe customer’s address information.
tags[String]The tags associated with the customer.
hasAccessBooleanIndicates if the customer has access rights to the store.
usernameStringThe username of the customer.
firstNameStringThe first name of the customer.
lastNameStringThe last name of the customer.
languageLocaleThe customer’s language/locale information.
currencyCurrencyThe customer’s preferred currency.
acceptsMarketingBooleanIndicates if the customer has accepted marketing communications.
consents[ConsentRecord]!Recorded customer consents, newest first.
orderCountIntThe total number of orders placed by the customer.
orderTotalFloatThe total amount spent by the customer on orders.
refundCountIntThe total number of refunds issued to the customer.
refundTotalFloatThe total amount refunded to the customer.
firstOrderDateStringThe date and time of the customer’s first order, in RFC 2822 format.
lastOrderDateStringThe 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.
loyaltyDiscountProgressLoyaltyDiscountProgressReturns the progress of the customer towards the next loyalty discount in a GraphQL compatible format.
metafields[Metafield]!Metafields stored on this resource.
metafieldMetafieldA 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

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