创建顾客
POST/openapi/2026-07/customers
使用提供的详情创建新顾客。
请求
- application/json
- 请求体
- 示例
请求体必填
- Array [
- ]
customer object必填
顾客信息
phone 或 email。若为 phone,则电话参数必填;否则邮箱参数必填
顾客的名
顾客的姓
顾客的密码
密码确认
顾客的标签
创建时间,格式为 ISO-8601
addresses object[]
顾客对象下的地址列表
地址所在国家名称,至少 1 个字符,如 "China"
ISO 国家代码,至少 1 个字符,如中国为 "CN"
收件人的名
收件人的姓
地址,如门牌号和街道名称,用于指定地址的主要位置
附加地址,如公寓号或套房号,用于提供更具体的地址信息
地址所在区域或地区
地址所在城市,指定城市或乡镇的名称
地址所在省份或州,指定国家内的行政区划或地区
地址所在省份代码,指定省份或州的简称或标准化代码
与地址关联的公司名称
收件人的电话号码
电话号码区号,用于标识特定地理区域的电话代码
地址的邮政编码,用于标识特定地理区域的邮件投递代码
人员性别,可选字段。可接受值为 "male" 和 "female"
收件人的电子邮件地址,用于指定收件人的邮箱
是否为默认地址。若为用户创建的第一个地址则为 "true",否则为 "false"
电子邮件地址,当 contact_type 为 email 时必填
含区号的电话号码,当 contact_type 为 phone 时必填
是否订阅营销邮件活动,默认为 true
true是否订阅短信营销活动,默认为 true
true{
"customer": {
"contact_type": "string",
"first_name": "string",
"last_name": "string",
"password": "string",
"password_confirmation": "string",
"tags": [
"string"
],
"registered_at": "string",
"addresses": [
{
"country": "string",
"country_code": "string",
"first_name": "string",
"last_name": "string",
"address1": "string",
"address2": "string",
"area": "string",
"city": "string",
"province": "string",
"province_code": "string",
"company": "string",
"phone": "string",
"phone_area_code": "string",
"zip": "string",
"gender": "string",
"email": "string",
"default": true
}
],
"email": "string",
"phone": "string",
"accepts_marketing": true,
"accepts_sms_marketing": true
}
}
响应
- 200
OK
- application/json
- 数据结构
- 示例
数据结构
- Array [
- ]
错误码
错误信息
data object
customer object
顾客信息
顾客的唯一标识
顾客的电子邮件地址
顾客创建时间,ISO-8601 格式
顾客最后更新时间,ISO-8601 格式
顾客的名
顾客的姓
顾客的电话号码
顾客标签
顾客的名字
电话号码的区号
联系方式类型,邮箱或电话
顾客的短信订阅状态标志
addresses object[]
顾客的所有地址列表
地址的唯一标识
顾客 ID
收件人的名
收件人的姓
公司名称
地址所在城市
地址所在省份或州
地址所在国家名称
邮政编码
省份代码
ISO 国家代码
收件人的性别
与地址关联的电话号码
电话号码的区号
地址所在区域或地区
与地址关联的电子邮件
收件人的全名
地址1
地址2
国家全称
是否为默认地址
顾客是否订阅了营销邮件
顾客数据来源
顾客是否享有税收豁免
顾客是否已注册
顾客的累计下单数量
首次下单时间
顾客最后一次下单时间
顾客的累计消费金额
顾客的营销订阅状态
顾客是否订阅了短信营销活动
{
"code": "string",
"message": "string",
"data": {
"customer": {
"id": "string",
"email": "string",
"created_at": "string",
"updated_at": "string",
"first_name": "string",
"last_name": "string",
"phone": "string",
"tags": [
"string"
],
"name": "string",
"phone_area_code": "string",
"contact_type": "string",
"sms_subscribed_flag": 0,
"addresses": [
{
"id": "string",
"customer_id": "string",
"first_name": "string",
"last_name": "string",
"company": "string",
"city": "string",
"province": "string",
"country": "string",
"zip": "string",
"province_code": "string",
"country_code": "string",
"gender": "string",
"phone": "string",
"phone_area_code": "string",
"area": "string",
"email": "string",
"name": "string",
"address1": "string",
"address2": "string",
"country_name": "string",
"default": true
}
],
"accepts_marketing": true,
"source": "string",
"free_tax": true,
"registered": true,
"orders_count": 0,
"first_order_at": "string",
"last_order_at": "string",
"total_spent": "string",
"subscribed_flag": 0,
"accepts_sms_marketing": true
}
}
}