Skip to main content

User Object

Represents user data.

type User implements Node, ObjectWithMetadata {
id: ID!
privateMetadata: [MetadataItem!]!
privateMetafield(
key: String!
): String
privateMetafields(
keys: [String!]
): Metadata
metadata: [MetadataItem!]!
metafield(
key: String!
): String
metafields(
keys: [String!]
): Metadata
email: String!
firstName: String!
lastName: String!
isStaff: Boolean!
isActive: Boolean!
isConfirmed: Boolean!
addresses: [Address!]!
checkout: Checkout @deprecated
checkoutTokens(
channel: String
): [UUID!] @deprecated
checkoutIds(
channel: String
): [ID!]
checkouts(
channel: String
before: String
after: String
first: Int
last: Int
): CheckoutCountableConnection
giftCards(
before: String
after: String
first: Int
last: Int
): GiftCardCountableConnection
note: String
orders(
before: String
after: String
first: Int
last: Int
): OrderCountableConnection
userPermissions: [UserPermission!]
permissionGroups: [Group!]
editableGroups: [Group!]
accessibleChannels: [Channel!]
restrictedAccessToChannels: Boolean!
avatar(
size: Int
format: ThumbnailFormatEnum = ORIGINAL
): Image
events: [CustomerEvent!]
storedPaymentSources(
channel: String
): [PaymentSource!]
languageCode: LanguageCodeEnum!
defaultShippingAddress: Address
defaultBillingAddress: Address
externalReference: String
lastLogin: DateTime
dateJoined: DateTime!
updatedAt: DateTime!
storedPaymentMethods(
channel: String!
): [StoredPaymentMethod!]
}

Fields

id ● ID!

The ID of the user.

privateMetadata ● [MetadataItem!]!

List of private metadata items. Requires staff permissions to access.

privateMetafield ● String

A single key from private metadata. Requires staff permissions to access.

Tip: Use GraphQL aliases to fetch multiple keys.

key ● String!

privateMetafields ● Metadata

Private metadata. Requires staff permissions to access. Use keys to control which fields you want to include. The default is to include everything.

keys ● [String!]

metadata ● [MetadataItem!]!

List of public metadata items. Can be accessed without permissions.

metafield ● String

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

key ● String!

metafields ● Metadata

Public metadata. Use keys to control which fields you want to include. The default is to include everything.

keys ● [String!]

email ● String!

The email address of the user.

firstName ● String!

The given name of the address.

lastName ● String!

The family name of the address.

isStaff ● Boolean!

Determine if the user is a staff admin.

isActive ● Boolean!

Determine if the user is active.

isConfirmed ● Boolean!

Determines if user has confirmed email.

addresses ● [Address!]!

List of all user's addresses.

checkoutIds ● [ID!]

Returns the checkout ID's assigned to this user.

channel ● String

Slug of a channel for which the data should be returned.

checkouts ● CheckoutCountableConnection

Returns checkouts assigned to this user. The query will not initiate any external requests, including fetching external shipping methods, filtering available shipping methods, or performing external tax calculations.

channel ● String

Slug of a channel for which the data should be returned.

before ● String

Return the elements in the list that come before the specified cursor.

after ● String

Return the elements in the list that come after the specified cursor.

first ● Int

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

last ● Int

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

giftCards ● GiftCardCountableConnection

List of the user gift cards.

before ● String

Return the elements in the list that come before the specified cursor.

after ● String

Return the elements in the list that come after the specified cursor.

first ● Int

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

last ● Int

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

note ● String

A note about the customer.

Requires one of the following permissions: MANAGE_USERSMANAGE_STAFF

orders ● OrderCountableConnection

List of user's orders. The query will not initiate any external requests, including filtering available shipping methods, or performing external tax calculations.

Requires one of the following permissions: MANAGE_STAFFOWNER
before ● String

Return the elements in the list that come before the specified cursor.

after ● String

Return the elements in the list that come after the specified cursor.

first ● Int

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

last ● Int

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

userPermissions ● [UserPermission!]

List of user's permissions.

permissionGroups ● [Group!]

List of user's permission groups.

editableGroups ● [Group!]

List of user's permission groups which user can manage.

accessibleChannels ● [Channel!]

List of channels the user has access to. The sum of channels from all user groups. If at least one group has restrictedAccessToChannels set to False - all channels are returned.

restrictedAccessToChannels ● Boolean!

Determine if user have restricted access to channels. False if at least one user group has restrictedAccessToChannels set to False.

avatar ● Image

The avatar of the user.

size ● Int

Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended).

format ● ThumbnailFormatEnum

The format of the image. When not provided, format of the original image will be used.

events ● [CustomerEvent!]

List of events associated with the user.

Requires one of the following permissions: MANAGE_USERSMANAGE_STAFF

storedPaymentSources ● [PaymentSource!]

List of stored payment sources. The field returns a list of payment sources stored for payment plugins.

channel ● String

Slug of a channel for which the data should be returned.

languageCode ● LanguageCodeEnum!

User language code.

defaultShippingAddress ● Address

The default shipping address of the user.

defaultBillingAddress ● Address

The default billing address of the user.

externalReference ● String

External ID of this user.

lastLogin ● DateTime

The date when the user last time log in to the system.

dateJoined ● DateTime!

The data when the user create account.

updatedAt ● DateTime!

The data when the user last update the account information.

storedPaymentMethods ● [StoredPaymentMethod!]

Returns a list of user's stored payment methods that can be used in provided channel. The field returns a list of stored payment methods by payment apps. When amount is not provided, 0 will be used as default value.

channel ● String!

Slug of a channel for which the data should be returned.

Show deprecated

Interfaces

Node

An object with an ID

ObjectWithMetadata

Returned By

me query ● user query

Member Of

AccountAddressCreate object ● AccountAddressDelete object ● AccountAddressUpdate object ● AccountChangeEmailRequested object ● AccountConfirmationRequested object ● AccountConfirmed object ● AccountDelete object ● AccountDeleted object ● AccountDeleteRequested object ● AccountEmailChanged object ● AccountRegister object ● AccountSetDefaultAddress object ● AccountSetPasswordRequested object ● AccountUpdate object ● AddressCreate object ● AddressDelete object ● AddressSetDefault object ● AddressUpdate object ● AppProblemDismissed object ● Checkout object ● ConfirmAccount object ● ConfirmEmailChange object ● CreateToken object ● CustomerBulkResult object ● CustomerCreate object ● CustomerCreated object ● CustomerDelete object ● CustomerEvent object ● CustomerMetadataUpdated object ● CustomerUpdate object ● CustomerUpdated object ● ExportEvent object ● ExportFile object ● ExternalObtainAccessTokens object ● ExternalRefresh object ● ExternalVerify object ● GiftCard object ● GiftCardEvent object ● Group object ● ListStoredPaymentMethods object ● Order object ● OrderEvent object ● OrderGrantedRefund object ● PasswordChange object ● PaymentGatewayInitializeTokenizationSession object ● PaymentMethodInitializeTokenizationSession object ● PaymentMethodProcessTokenizationSession object ● RefreshToken object ● RequestEmailChange object ● SetPassword object ● StaffCreate object ● StaffCreated object ● StaffDelete object ● StaffDeleted object ● StaffNotificationRecipient object ● StaffSetPasswordRequested object ● StaffUpdate object ● StaffUpdated object ● StoredPaymentMethodDeleteRequested object ● UserAvatarDelete object ● UserAvatarUpdate object ● UserCountableEdge object ● VerifyToken object

Implemented By

_Entity union ● IssuingPrincipal union ● UserOrApp union