---
title: "CustomerInput"
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/inputs/customer-input'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/inputs/customer-input.md'
---
# CustomerInput

用于创建客户的输入字段。

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

## Type Signature

`CustomerInput`

## Input Fields

* `firstName`

  [String](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.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)

  是否免税

* `lastName`

  [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

* `email`

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

  邮件

* `taxExemptions`

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

  客户免税的国家区域列表

* `addresses`

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

  客户的地址

* `smsMarketingConsent`

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

  用于客户同意/拒绝通过短信接收营销资讯

* `note`

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

  备注

* `phone`

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

  手机号码

* `emailMarketingConsent`

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

  用于客户同意通过电子邮件接收营销信息，例如电子邮件

## Schema Definition

```graphql
input CustomerInput { 
	firstName: String
	tags: [String]
	taxExempt: Boolean
	lastName: String
	id: ID
	email: String
	taxExemptions: [FreeAreasInput]
	addresses: [MailingAddressInput]
	smsMarketingConsent: CustomerSmsMarketingConsentInput
	note: String
	phone: String
	emailMarketingConsent: CustomerEmailMarketingConsentInput 
}
```

## Argument from

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

  更新客户的默认地址

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

  按ID更新客户信息

## 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)。

