Customer

Required access

read_customers access scope

Show definition
type Customer implements Node, CommentEventSubject, HasMetafields {
  # Globally unique identifier.
  id: ID!

  # Whether the merchant has added timeline comments about the customer on the customer's page.
  hasTimelineComment: Boolean!

  # The metafield associated with the resource.
  metafield(
    # Container for a set of metafields (maximum of 20 characters).
    namespace: String!

    # Identifier for the metafield (maximum of 30 characters).
    key: String!
  ): Metafield

  # A paginated list of metafields associated with the resource.
  metafields(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false
  ): MetafieldConnection!

  # Whether the customer has agreed to receive marketing materials.
  acceptsMarketing: Boolean!

  # A list of addresses associated with the customer.
  addresses(
    # Truncate the array result to this size.
    first: Int
  ): [MailingAddress!]!

  # The average amount that the customer spent per order.
  averageOrderAmount: Money

  # The average amount that the customer spent per order.
  averageOrderAmountV2: MoneyV2

  # Whether the merchant can delete the customer from their store.
  #
  # A customer can be deleted from a store only if they have not yet made an
  # order. After a customer makes an order, they can't be deleted from a store.
  canDelete: Boolean!

  # The date and time when the customer was added to the store.
  createdAt: DateTime!

  # The default address associated with the customer.
  defaultAddress: MailingAddress

  # The full name of the customer, based on the values for first_name and last_name.
  displayName: String!

  # The customer's email address.
  email: String

  # A list of events associated with the customer.
  events(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: EventSortKeys = ID

    # Supported filter parameters:
    #  - `created_at`
    #  - `comments`
    query: String
  ): EventConnection!

  # The customer's first name.
  firstName: String

  # Whether the customer has a note associated with them.
  hasNote: Boolean!

  # The image associated with the customer.
  image(
    # Image width and height (1 - 2048 pixels) This argument is deprecated: Use
    # `maxWidth` or `maxHeight` on `Image.transformedSrc` instead.
    size: Int
  ): Image!

  # The customer's last name.
  lastName: String

  # The customer's last order.
  lastOrder: Order

  # The amount of time since the customer was first added to the store.
  #
  # Example: 'about 12 years'.
  lifetimeDuration: String!

  # A note about the customer.
  note: String

  # A list of the customer's orders.
  orders(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: OrderSortKeys = ID

    # Supported filter parameters:
    #  - `status`
    #  - `financial_status`
    #  - `fulfillment_status`
    #  - `source_name`
    #  - `chargeback_status`
    #  - `risk_level`
    #  - `customer_id`
    #  - `email`
    #  - `credit_card_last4`
    #  - `processed_at`
    #  - `checkout_token`
    #  - `cart_token`
    #  - `location_id`
    #  - `channel_id`
    #  - `sales_channel`
    #  - `discount_code`
    #  - `test`
    #  - `fraud_protection_level`
    #  - `reference_location_id`
    #  - `tag`
    #  - `updated_at`
    #  - `created_at`
    query: String
  ): OrderConnection!

  # The number of orders that the customer has made at the store in their lifetime.
  ordersCount: UnsignedInt64!

  # The customer's phone number.
  phone: String

  # The state or province where the customer resides.
  state: CustomerState!

  # A list of tags assigned to the customer.
  tags: [String!]!

  # Whether the customer is exempt from being charged taxes on their orders.
  taxExempt: Boolean!

  # The total amount that the customer has spent on orders in their lifetime.
  totalSpent: Money!

  # The total amount that the customer has spent on orders in their lifetime.
  totalSpentV2: MoneyV2!

  # The date and time when the customer was last updated.
  updatedAt: DateTime!

  # Whether the email address is formatted correctly.
  #
  # Returns true when the email is formatted correctly and
  # belongs to an existing domain. This does not guarantee
  # that the email address actually exists.
  validEmailAddress: Boolean!

  # Whether the email address is formatted correctly.
  verifiedEmail: Boolean!
}

Implements

Connections

events   (EventConnection!)

A list of events associated with the customer.

Required access

read_ access scope

Argument Type Default Description
after

String

Returns the elements that come after the specified cursor.

before

String

Returns the elements that come before the specified cursor.

first

Int

Returns up to the first n elements from the list.

last

Int

Returns up to the last n elements from the list.

query

String

Supported filter parameters:

  • created_at
  • comments

reverse

Boolean

false

Reverse the order of the underlying list.

sortKey

EventSortKeys

ID

Sort the underlying list by the given key.

metafields   (MetafieldConnection!)

A paginated list of metafields associated with the resource.

Required access

read_ access scope

Argument Type Default Description
after

String

Returns the elements that come after the specified cursor.

before

String

Returns the elements that come before the specified cursor.

first

Int

Returns up to the first n elements from the list.

last

Int

Returns up to the last n elements from the list.

reverse

Boolean

false

Reverse the order of the underlying list.

orders   (OrderConnection!)

A list of the customer's orders.

Required access

read_ access scope

Argument Type Default Description
after

String

Returns the elements that come after the specified cursor.

before

String

Returns the elements that come before the specified cursor.

first

Int

Returns up to the first n elements from the list.

last

Int

Returns up to the last n elements from the list.

query

String

Supported filter parameters:

  • status
  • financial_status
  • fulfillment_status
  • source_name
  • chargeback_status
  • risk_level
  • customer_id
  • email
  • credit_card_last4
  • processed_at
  • checkout_token
  • cart_token
  • location_id
  • channel_id
  • sales_channel
  • discount_code
  • test
  • fraud_protection_level
  • reference_location_id
  • tag
  • updated_at
  • created_at

reverse

Boolean

false

Reverse the order of the underlying list.

sortKey

OrderSortKeys

ID

Sort the underlying list by the given key.

Fields

acceptsMarketing   (Boolean!)

Whether the customer has agreed to receive marketing materials.

Required access

read_ access scope

addresses   ([MailingAddress!]!)

A list of addresses associated with the customer.

Required access

read_ access scope

Argument Type Default Description
first

Int

Truncate the array result to this size.

averageOrderAmountV2   (MoneyV2)

The average amount that the customer spent per order.

Required access

read_ access scope

canDelete   (Boolean!)

Whether the merchant can delete the customer from their store.

A customer can be deleted from a store only if they have not yet made an order. After a customer makes an order, they can't be deleted from a store.

Required access

read_ access scope

createdAt   (DateTime!)

The date and time when the customer was added to the store.

Required access

read_ access scope

defaultAddress   (MailingAddress)

The default address associated with the customer.

Required access

read_ access scope

displayName   (String!)

The full name of the customer, based on the values for first_name and last_name.

Required access

read_ access scope

email   (String)

The customer's email address.

Required access

read_ access scope

firstName   (String)

The customer's first name.

Required access

read_ access scope

hasNote   (Boolean!)

Whether the customer has a note associated with them.

Required access

read_ access scope

hasTimelineComment   (Boolean!)

Whether the merchant has added timeline comments about the customer on the customer's page.

Required access

read_ access scope

id   (ID!)

Globally unique identifier.

Required access

read_ access scope

image   (Image!)

The image associated with the customer.

Required access

read_ access scope

Argument Type Default Description
size

Int

Image width and height (1 - 2048 pixels) This argument is deprecated: Use maxWidth or maxHeight on Image.transformedSrc instead.

lastName   (String)

The customer's last name.

Required access

read_ access scope

lastOrder   (Order)

The customer's last order.

Required access

read_ access scope

lifetimeDuration   (String!)

The amount of time since the customer was first added to the store.

Example: 'about 12 years'.

Required access

read_ access scope

metafield   (Metafield)

The metafield associated with the resource.

Required access

read_ access scope

Argument Type Default Description
key

required

String!

Identifier for the metafield (maximum of 30 characters).

namespace

required

String!

Container for a set of metafields (maximum of 20 characters).

note   (String)

A note about the customer.

Required access

read_ access scope

ordersCount   (UnsignedInt64!)

The number of orders that the customer has made at the store in their lifetime.

Required access

read_ access scope

phone   (String)

The customer's phone number.

Required access

read_ access scope

state   (CustomerState!)

The state or province where the customer resides.

Required access

read_ access scope

tags   ([String!]!)

A list of tags assigned to the customer.

Required access

read_ access scope

taxExempt   (Boolean!)

Whether the customer is exempt from being charged taxes on their orders.

Required access

read_ access scope

totalSpent   (Money!)

The total amount that the customer has spent on orders in their lifetime.

Required access

read_ access scope

totalSpentV2   (MoneyV2!)

The total amount that the customer has spent on orders in their lifetime.

Required access

read_ access scope

updatedAt   (DateTime!)

The date and time when the customer was last updated.

Required access

read_ access scope

validEmailAddress   (Boolean!)

Whether the email address is formatted correctly.

Returns true when the email is formatted correctly and belongs to an existing domain. This does not guarantee that the email address actually exists.

Required access

read_ access scope

Deprecated fields

Show/Hide

averageOrderAmount   (Money)

deprecated

The average amount that the customer spent per order.

Deprecation warning

Use averageOrderAmountV2 instead

Required access

read_ access scope

verifiedEmail   (Boolean!)

deprecated

Whether the email address is formatted correctly.

Deprecation warning

Use validEmailAddress instead

Required access

read_ access scope

Sign up for a Partner account to get started.

Sign up