Home > @infiniteobjects/shopify-data-manager > AdminTypes > Customer
Represents information about a customer of the shop, such as the customer’s contact details, their order history, and whether they’ve agreed to receive marketing material by email.
**Caution:** Only use this data if it’s required for your app’s functionality. Shopify will restrict [access to scopes](https://shopify.dev/api/usage/access-scopes) for apps that don’t have a legitimate use for the associated data.
Signature:
export interface Customer extends CommentEventSubject, HasEvents, HasMetafieldDefinitions, HasMetafields, LegacyInteroperability, Node
Extends: CommentEventSubject, HasEvents, HasMetafieldDefinitions, HasMetafields, LegacyInteroperability, Node
Property | Modifiers | Type | Description |
---|---|---|---|
acceptsMarketing | Scalars[‘Boolean’][‘output’] | Whether the customer has agreed to receive marketing material. | |
acceptsMarketingUpdatedAt | Scalars[‘DateTime’][‘output’] | The date and time when the customer consented or objected to receiving marketing material by email. | |
addresses | Array<MailingAddress> | A list of addresses associated with the customer. | |
amountSpent | MoneyV2 | The total amount that the customer has spent on orders in their lifetime. | |
canDelete | Scalars[‘Boolean’][‘output’] | <p>Whether the merchant can delete the customer from their store.</p><p>A customer can be deleted from a store only if they haven’t yet made an order. After a customer makes an order, they can’t be deleted from a store.</p> | |
companyContactProfiles | Array<CompanyContact> | A list of the customer’s company contact profiles. | |
createdAt | Scalars[‘DateTime’][‘output’] | The date and time when the customer was added to the store. | |
defaultAddress? | Maybe<MailingAddress> | (Optional) The default address associated with the customer. | |
displayName | Scalars[‘String’][‘output’] | The full name of the customer, based on the values for first_name and last_name. If the first_name and last_name are not available, then this falls back to the customer’s email address, and if that is not available, the customer’s phone number. | |
email? | Maybe<Scalars[‘String’][‘output’]> | (Optional) The customer’s email address. | |
emailMarketingConsent? | Maybe<CustomerEmailMarketingConsentState> | (Optional) The current email marketing state for the customer. If the customer doesn’t have an email address, then this property is null . |
|
events | EventConnection | A list of events associated with the customer. | |
firstName? | Maybe<Scalars[‘String’][‘output’]> | (Optional) The customer’s first name. | |
hasTimelineComment | Scalars[‘Boolean’][‘output’] | Whether the merchant has added timeline comments about the customer on the customer’s page. | |
id | Scalars[‘ID’][‘output’] | A globally-unique ID. | |
image | Image | The image associated with the customer. | |
lastName? | Maybe<Scalars[‘String’][‘output’]> | (Optional) The customer’s last name. | |
lastOrder? | Maybe<Order> | (Optional) The customer’s last order. | |
legacyResourceId | Scalars[‘UnsignedInt64’][‘output’] | The ID of the corresponding resource in the REST Admin API. | |
lifetimeDuration | Scalars[‘String’][‘output’] | <p>The amount of time since the customer was first added to the store.</p><p>Example: ‘about 12 years’.</p> | |
locale | Scalars[‘String’][‘output’] | The customer’s locale. | |
market? | Maybe<Market> | (Optional) The market that includes the customer’s default address. | |
marketingOptInLevel? | Maybe<CustomerMarketingOptInLevel | `${CustomerMarketingOptInLevel}`> | <p>(Optional) The marketing subscription opt-in level, as described by the M3AAWG best practices guidelines, that the customer gave when they consented to receive marketing material by email.</p><p>If the customer doesn’t accept email marketing, then this property is null .</p> |
|
mergeable | CustomerMergeable | Whether the customer can be merged with another customer. | |
metafield? | Maybe<Metafield> | (Optional) Returns a metafield by namespace and key that belongs to the resource. | |
metafieldDefinitions | MetafieldDefinitionConnection | List of metafield definitions. | |
metafields | MetafieldConnection | List of metafields that belong to the resource. | |
multipassIdentifier? | Maybe<Scalars[‘String’][‘output’]> | (Optional) A unique identifier for the customer that’s used with Multipass login. | |
note? | Maybe<Scalars[‘String’][‘output’]> | (Optional) A note about the customer. | |
numberOfOrders | Scalars[‘UnsignedInt64’][‘output’] | The number of orders that the customer has made at the store in their lifetime. | |
orders | OrderConnection | A list of the customer’s orders. | |
paymentMethods | CustomerPaymentMethodConnection | A list of the customer’s payment methods. | |
phone? | Maybe<Scalars[‘String’][‘output’]> | (Optional) The customer’s phone number. | |
privateMetafield? | Maybe<PrivateMetafield> | (Optional) Returns a private metafield by namespace and key that belongs to the resource. | |
privateMetafields | PrivateMetafieldConnection | List of private metafields that belong to the resource. | |
productSubscriberStatus | CustomerProductSubscriberStatus | `${CustomerProductSubscriberStatus}` | Possible subscriber states of a customer defined by their subscription contracts. | |
smsMarketingConsent? | Maybe<CustomerSmsMarketingConsentState> | <p>(Optional) The current SMS marketing state for the customer’s phone number.</p><p>If the customer does not have a phone number, then this property is null .</p> |
|
state | CustomerState | `${CustomerState}` | The state of the customer’s account with the shop. | |
statistics | CustomerStatistics | The statistics for a given customer. | |
subscriptionContracts | SubscriptionContractConnection | A list of the customer’s subscription contracts. | |
tags | Array<Scalars[‘String’][‘output’]> | A comma separated list of tags that have been added to the customer. | |
taxExempt | Scalars[‘Boolean’][‘output’] | Whether the customer is exempt from being charged taxes on their orders. | |
taxExemptions | Array<TaxExemption | `${TaxExemption}`> | The list of tax exemptions applied to the customer. | |
unsubscribeUrl | Scalars[‘URL’][‘output’] | The URL to unsubscribe the customer from the mailing list. | |
updatedAt | Scalars[‘DateTime’][‘output’] | The date and time when the customer was last updated. | |
validEmailAddress | Scalars[‘Boolean’][‘output’] | <p>Whether the email address is formatted correctly.</p><p>Returns true when the email is formatted correctly and belongs to an existing domain. This doesn’t guarantee that the email address actually exists.</p> |
|
verifiedEmail | Scalars[‘Boolean’][‘output’] | Whether the customer has verified their email address. Defaults to true if the customer is created through the Shopify admin or API. |