版本:202607
更新顾客
PUT/openapi/2026-07/customers/:customer_id
通过顾客 ID 更新现有顾客的详细信息。
请求
Path参数
customer_id string必填
顾客 ID
- application/json
- 请求体
- 示例
请求体必填
customer object必填
顾客信息
first_namestring
顾客的名
last_namestring
顾客的姓
accepts_marketingboolean
是否订阅营销邮件活动
accepts_sms_marketingboolean
是否订阅短信营销活动
tagsstring[]
分配给顾客的标签
{
"customer": {
"first_name": "string",
"last_name": "string",
"accepts_marketing": true,
"accepts_sms_marketing": true,
"tags": [
"string"
]
}
}
响应
- 200
OK
- application/json
- 数据结构
- 示例
数据结构
- Array [
- ]
codestring
错误码
messagestring
错误信息
data object
customer object
顾客信息
idstring
顾客的唯一标识
emailstring
顾客的电子邮件地址
created_atstring
顾客创建时间,ISO-8601 格式
updated_atstring
顾客最后更新时间,ISO-8601 格式
first_namestring
顾客的名
last_namestring
顾客的姓
phonestring
顾客的电话号码
tagsstring[]
顾客标签
namestring
顾客的名字
phone_area_codestring
电话号码的区号
contact_typestring
联系方式类型,邮箱或电话
sms_subscribed_flagint32
顾客的短信订阅状态标志
addresses object[]
顾客的所有地址列表
idstring
地址的唯一标识
customer_idstring
顾客 ID
first_namestring
收件人的名
last_namestring
收件人的姓
companystring
公司名称
citystring
地址所在城市
provincestring
地址所在省份或州
countrystring
地址所在国家名称
zipstring
邮政编码
province_codestring
省份代码
country_codestring
ISO 国家代码
genderstring
收件人的性别
phonestring
与地址关联的电话号码
phone_area_codestring
电话号码的区号
areastring
地址所在区域或地区
emailstring
与地址关联的电子邮件
namestring
收件人的全名
address1string
地址1
address2string
地址2
country_namestring
国家全称
defaultboolean
是否为默认地址
accepts_marketingboolean
顾客是否订阅了营销邮件
sourcestring
顾客数据来源
free_taxboolean
顾客是否享有税收豁免
registeredboolean
顾客是否已注册
orders_countint32
顾客的累计下单数量
first_order_atstring
首次下单时间
last_order_atstring
顾客最后一次下单时间
total_spentstring
顾客的累计消费金额
subscribed_flagint32
顾客的营销订阅状态
accepts_sms_marketingboolean
顾客是否订阅了短信营销活动
{
"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
}
}
}