顾客-Customer 对象
表示有关商店客户的信息,例如客户的联系方式,他们的订单历史记录以及他们是否同意接受电子邮件营销。
所需的访问
read_customers 访问范围。
在本页面
Connecttions
- 活动(
[EventConnection!](https://shopify.dev/docs/admin-api/graphql/reference/events/eventconnection))
与客户关联的事件列表。 
| 参数 | 描述 | 
|---|---|
after() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
返回指定游标之后的元素。 | 
before() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
返回指定游标之前的元素。 | 
first() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
返回n列表中的第一个元素。 | 
last() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
返回n列表中的最后一个元素。 | 
query() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
支持的过滤器参数: + comments+ created_at+ subject_type+ verb有关使用过滤器的更多信息,请参见详细的搜索语法。  | 
reverse() [Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01) | 
颠倒基础列表的顺序。 默认值: false | 
sortKey() [EventSortKeys](https://shopify.dev/docs/admin-api/graphql/reference/events/eventsortkeys) | 
按给定键对基础列表进行排序。 默认值: ID | 
- 元字段(
[MetafieldConnection!](https://shopify.dev/docs/admin-api/graphql/reference/metafields/metafieldconnection))
与资源关联的元字段的分页列表。 
| 参数 | 描述 | 
|---|---|
after() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
返回指定游标之后的元素。 | 
before() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
返回指定游标之前的元素。 | 
first() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
返回n列表中的第一个元素。 | 
last() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
返回n列表中的最后一个元素。 | 
namespace() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
在资源下查找具有特定名称空间的所有元字段。 | 
reverse() [Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01) | 
颠倒基础列表的顺序。 默认值: false | 
- 订单(
[OrderConnection!](https://shopify.dev/docs/admin-api/graphql/reference/orders/order))
客户订单清单。 
| 参数 | 描述 | 
|---|---|
after() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
返回指定游标之后的元素。 | 
before() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
返回指定游标之前的元素。 | 
first() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
返回n列表中的第一个元素。 | 
last() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
返回n列表中的最后一个元素。 | 
query() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
支持的过滤器参数: + cart_token+ channel_id+ chargeback_status+ checkout_token+ created_at+ credit_card_last4+ customer_id+ delivery_method+ discount_code+ email+ financial_status+ fraud_protection_level+ fulfillment_location_id+ fulfillment_status+ location_id+ name+ processed_at+ reference_location_id+ return_status+ risk_level+ sales_channel+ source_identifier+ source_name+ status+ tag+ test+ updated_at有关使用过滤器的更多信息,请参见详细的搜索语法。  | 
reverse() [Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01) | 
颠倒基础列表的顺序。 默认值: false | 
sortKey() [OrderSortKeys](https://shopify.dev/docs/admin-api/graphql/reference/orders/ordersortkeys) | 
按给定键对基础列表进行排序。 默认值: ID | 
- paymentMethods(
[CustomerPaymentMethodConnection!](https://shopify.dev/docs/admin-api/graphql/reference/customers/customerpaymentmethod))
客户的付款方式列表。 
| 参数 | 描述 | 
|---|---|
after() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
返回指定游标之后的元素。 | 
before() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
返回指定游标之前的元素。 | 
first() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
返回n列表中的第一个元素。 | 
last() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
返回n列表中的最后一个元素。 | 
reverse() [Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01) | 
颠倒基础列表的顺序。 默认值: false | 
showRevoked() [Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01) | 
是否显示客户被撤销的付款方式。 默认值: false | 
- privateMetafields(
[PrivateMetafieldConnection!](https://shopify.dev/docs/admin-api/graphql/reference/metafields/privatemetafieldconnection))
私有元字段列表。 
| 参数 | 描述 | 
|---|---|
after() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
返回指定游标之后的元素。 | 
before() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
返回指定游标之前的元素。 | 
first() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
返回n列表中的第一个元素。 | 
last() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
返回n列表中的最后一个元素。 | 
namespace() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
按名称空间过滤私有元字段。 | 
reverse() [Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01) | 
颠倒基础列表的顺序。 默认值: false | 
- subscriptionContracts(
[SubscriptionContractConnection!](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptioncontract))
客户的订购合同列表。 
| 参数 | 描述 | 
|---|---|
after() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
返回指定游标之后的元素。 | 
before() [String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01) | 
返回指定游标之前的元素。 | 
first() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
返回n列表中的第一个元素。 | 
last() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
返回n列表中的最后一个元素。 | 
reverse() [Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01) | 
颠倒基础列表的顺序。 默认值: false | 
字段
- acceptsMarketing(
[Boolean!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01))
客户是否已同意接收营销材料。 - acceptsMarketingUpdatedAt(
[DateTime!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#datetime-2021-01))
客户同意或反对通过电子邮件接收营销材料的日期和时间。 - addresses(
[[MailingAddress!]!](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/mailingaddress))
与客户关联的地址列表。 
| 参数 | 描述 | 
|---|---|
first() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
将数组结果截断为此大小。 | 
- averageOrderAmountV2(
[MoneyV2](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/moneyv2))
客户每笔订单花费的平均金额。 - canDelete(
[Boolean!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01))
商家是否可以从其商店中删除客户。
只有尚未下订单的客户才能从商店中删除。客户下订单后,便无法将其从商店中删除。 - createdAt(
[DateTime!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#datetime-2021-01))
将客户添加到商店的日期和时间。 - defaultAddress(
[MailingAddress](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/mailingaddress))
与客户关联的默认地址。 - displayName(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
客户的全名,基于first_name和last_name的值。如果first_name和last_name不可用,则返回到客户的电子邮件地址,如果不可用,则返回客户的电话号码。 - email (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
客户的电子邮件地址。 - firstName(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
客户的名字。 - hasNote(
[Boolean!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01))
客户是否有与之关联的注释。 - hasTimelineComment(
[Boolean!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01))
商家是否在客户页面上添加了有关客户的时间表注释。 - id (
[ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01))
全局唯一标识符。 - image(
[Image!](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/image))
与客户关联的图像。 
| 参数 | 描述 | 
|---|---|
size() [Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01) | 
图像的宽度和高度(1 - 2048个像素)该参数已被弃用:使用maxWidth或maxHeight上Image.transformedSrc代替。 | 
- lastName(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
客户的姓氏。 - lastOrder(
[Order](https://shopify.dev/docs/admin-api/graphql/reference/orders/order))
客户的最后订单。 - legacyResourceId(
[UnsignedInt64!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#unsignedint64-2021-01))
REST Admin API中相应资源的ID。 - lifetimeDuration(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
自从首次将客户添加到商店以来的时间。
示例: ‘about 12 years’。 - locale(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
客户的语言环境。 - marketingOptInLevel(
[CustomerMarketingOptInLevel](https://shopify.dev/docs/admin-api/graphql/reference/customers/customermarketingoptinlevel))
客户同意通过电子邮件接收营销材料时给出的营销订阅选择加入级别(如M3AAWG最佳实践指南所述)。
如果客户不接受电子邮件营销,则此字段为null。 - metafield(
[Metafield](https://shopify.dev/docs/admin-api/graphql/reference/metafields/metafield))
与资源关联的元字段。 
- multipassIdentifier(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
与Multipass登录一起使用的客户的唯一标识符。 - note(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
关于客户的说明。 - ordersCount(
[UnsignedInt64!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#unsignedint64-2021-01))
客户一生中在商店中下的订单数。 - phone(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
客户的电话号码。 - privateMetafield(
[PrivateMetafield](https://shopify.dev/docs/admin-api/graphql/reference/metafields/privatemetafield))
返回通过名称空间和键找到的私有元字段。 
- productSubscriberStatus(
[CustomerProductSubscriberStatus!](https://shopify.dev/docs/admin-api/graphql/reference/customers/customerproductsubscriberstatus))
客户的订户合同定义的可能的订户状态。 - state(
[CustomerState!](https://shopify.dev/docs/admin-api/graphql/reference/customers/customerstate))
客户在商店中的帐户状态。 - tags(
[[String!]!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
以逗号分隔的已添加到客户的标签列表。 - taxExempt(
[Boolean!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01))
客户是否可以免收订单税。 - taxExemptions(
[[TaxExemption!]!](https://shopify.dev/docs/admin-api/graphql/reference/customers/taxexemption))
适用于客户的免税清单。 - totalSpent(
[Money!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#money-2021-01))
客户一生中在订单上花费的总金额。 - totalSpentV2(
[MoneyV2!](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/moneyv2))
客户一生中在订单上花费的总金额。 - UpdatedAt(
[DateTime!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#datetime-2021-01))
客户上次更新的日期和时间。 - validEmailAddress(
[Boolean!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01))
电子邮件地址格式是否正确。这不能保证电子邮件地址确实存在。 - verifiedEmail(
[Boolean!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01))
客户是否已验证其电子邮件地址。默认为true如果客户是通过Shopify管理员或API创建的。 
返回客户的类型
[CalculatedDraftOrder.customer](https://shopify.dev/docs/admin-api/graphql/reference/orders/calculateddraftorder#customer-2021-01)[CustomerPaymentMethod.customer](https://shopify.dev/docs/admin-api/graphql/reference/customers/customerpaymentmethod#customer-2021-01)[DiscountCustomers.customers](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountcustomers#customers-2021-01)[DraftOrder.customer](https://shopify.dev/docs/admin-api/graphql/reference/orders/draftorder#customer-2021-01)[Order.customer](https://shopify.dev/docs/admin-api/graphql/reference/orders/order#customer-2021-01)[PriceRuleCustomerSelection.customers](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/pricerulecustomerselection#customers-2021-01)[QueryRoot.customer](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/queryroot#customer-2021-01)[QueryRoot.customers](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/queryroot#customers-2021-01)[SubscriptionContract.customer](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptioncontract#customer-2021-01)[SubscriptionDraft.customer](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptiondraft#customer-2021-01)
客户的异常
- customerAddTaxExemptions
为客户增加免税。 - customerCreate
创建一个新客户。 - customerDelete
删除客户。 - customerGenerateAccountActivationUrl
生成一个新的帐户激活URL。 - customerRemoveTaxExemptions
取消客户的免税。 - customerReplaceTaxExemptions
替换对客户的免税。 - 客户更新
更新客户的字段。 - customerUpdateDefaultAddress
更新客户的默认地址。 
派生关系
[CommentEventSubject](https://shopify.dev/docs/admin-api/graphql/reference/events/commenteventsubject)[HasEvents](https://shopify.dev/docs/admin-api/graphql/reference/events/hasevents)[HasMetafields](https://shopify.dev/docs/admin-api/graphql/reference/metafields/hasmetafields)[LegacyInteroperability](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/legacyinteroperability)[Node](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/node)
在本页面
字段
- edges(
[[CustomerEdge!]!](https://shopify.dev/docs/admin-api/graphql/reference/customers/customer))
边列表。 - pageInfo(
[PageInfo!](https://shopify.dev/docs/admin-api/graphql/reference/pageinfo))
有助于分页的信息。 
一种自动生成的类型,在分页期间可容纳一个Customer和一个光标。
在本页面
字段
- cursor(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
用于分页的游标。 - node (
[Customer!](https://shopify.dev/docs/admin-api/graphql/reference/customers/customer)) The item at the end of CustomerEdge. 
返回CustomerEdge的类型
[CustomerConnection.edges](https://shopify.dev/docs/admin-api/graphql/reference/customers/customer#edges-2021-01)
