---
title: "Customer"
description: "客户对象"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer.md'
---
# Customer

客户对象

- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Object

## Type Signature

`Customer`

## Fields

* `addresses`

  [[MailingAddress]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/mailing-address.md)

  地址信息

* `amountSpent`

  [MoneyV2](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/money-v2.md)

  总花费金额

* `canDelete`

  [Boolean](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/boolean.md)

  能否被删除

* `createdAt`

  [Date](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/date.md)

  创建时间

* `defaultAddress`

  [MailingAddress](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/mailing-address.md)

  默认地址

* `displayName`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  全名

* `email`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  邮箱

* `emailMarketingConsent`

  [CustomerEmailMarketingConsentState](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer-email-marketing-consent-state.md)

  邮箱订阅信息

* `firstName`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  名字

* `id`

  [ID](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/id.md)

  客户id

* `lastName`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  姓氏

* `lifetimeDuration`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  客户加入店铺的时间，举例，例如 一天、一周、一年

* `locale`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  语言

* `note`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  备注

* `numberOfOrders`

  [Int](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/int.md)

  订单数

* `phone`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  手机号

* `smsMarketingConsent`

  [CustomerSmsMarketingConsentState](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer-sms-marketing-consent-state.md)

  短信订阅状态

* `state`

  [CustomerState](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/enums/customer-state.md)

  客户状态

* `tags`

  [[String]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  标签

* `taxExempt`

  [Boolean](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/boolean.md)

  客户的订单能免税标识，true:能免税，false：不能免税

* `taxExemptions`

  [[FreeAreas]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/free-areas.md)

  客户免税列表

* `updatedAt`

  [Date](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/date.md)

  更新时间

* `validEmailAddress`

  [Boolean](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/boolean.md)

  邮箱地址校验，不保证邮箱地址真实性

* `verifiedEmail`

  [Boolean](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/boolean.md)

  邮箱是否验证

## Schema Definition

```graphql
type Customer { 
	addresses: [MailingAddress]
	amountSpent: MoneyV2
	canDelete: Boolean
	createdAt: Date
	defaultAddress: MailingAddress
	displayName: String
	email: String
	emailMarketingConsent: CustomerEmailMarketingConsentState
	firstName: String
	id: ID
	lastName: String
	lifetimeDuration: String
	locale: String
	note: String
	numberOfOrders: Int
	phone: String
	smsMarketingConsent: CustomerSmsMarketingConsentState
	state: CustomerState
	tags: [String]
	taxExempt: Boolean
	taxExemptions: [FreeAreas]
	updatedAt: Date
	validEmailAddress: Boolean
	verifiedEmail: Boolean 
}
```

## Field from

* [CompanyContact](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/b-2-b/objects/company-contact.md).customer

  客户信息

* [CustomerUpdatePayload](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer-update-payload.md).customer

  更新的客户

* [CustomerEmailMarketingConsentUpdatePayload](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer-email-marketing-consent-update-payload.md).customer

  更新的客户信息

* [CustomerCreatePayload](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer-create-payload.md).customer

  创建的客户

* [Query](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/queries/customer.md).customer

  按ID返回客户信息

* [CustomerConnection](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer-connection.md).nodes

  节点列表

* [CustomerReplaceTaxExemptionsPayload](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer-replace-tax-exemptions-payload.md).customer

  更新的客户信息

* [CustomerUpdateDefaultAddressPayload](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer-update-default-address-payload.md).customer

  更新默认地址的客户信息

* [CustomerEdge](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer-edge.md).node

  Customer节点信息

* [CustomerSmsMarketingConsentUpdatePayload](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer-sms-marketing-consent-update-payload.md).customer

  更新的客户信息

* [CustomerAddTaxExemptionsPayload](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer-add-tax-exemptions-payload.md).customer

  更新的客户信息

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes)。

