---
title: "customerCreate"
description: "创建客户"
doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/customers/mutations/customer-create'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/customers/mutations/customer-create.md'
---
# customerCreate

创建客户

- **Required Scopes:** `unauthenticated_write_customer_information`
- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Mutation

## Type Signature

`CustomerCreatePayload`

## Required Permissions

* `unauthenticated_write_customer_information`

接口访问需要令牌，具体如何获取令牌请参考：[身份认证](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/storefront-api/overview.md)

## Arguments

* `input`

  [CustomerCreateInput!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/customers/inputs/customer-create-input.md)

  创建客户的input对象

## Returns

* `customer`

  [Customer](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/customers/objects/customer.md)

  客户信息

* `customerUserErrors`

  [[CustomerUserError]](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/customers/objects/customer-user-error.md)

  错误信息

## Code Example

```graphql
mutation customerCreate($input: CustomerCreateInput! ) {
	customerCreate(input: $input ) 
		 {
			# CustomerCreatePayload fields
		}
		
	}

```

## Variables

```json
{
  "input": {
    "acceptsMarketing": {},
    "birthday": "",
    "channel": "",
    "email": "",
    "firstName": "",
    "gender": "",
    "lastName": {},
    "password": "",
    "phone": "",
    "source": "",
    "verifyToken": ""
  }
}
```

## Error Handling

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

