顾客-更新

Customer Update Customer API 文档

接口信息

  • 接口地址: {your-site-url}/api/skill/customer/update-customer
  • 基础 URL: {your-site-url} 需替换为你自己的独立站 URL 地址,如 https://your-domain.com/apimanager666
  • 请求方式: POST
  • Content-Type: application/json
  • 说明: 此接口用于更新指定客户的信息。emailstatus 不可通过此接口修改

认证

请求头中需要携带 skill-access-token

Header
skill-access-token {your-skill-access-token} (请替换为你自己的 token)

请求参数 (JSON Body)

字段 类型 必填 说明
id int ✅ 必填 客户 ID
first_name string 选填
last_name string 选填
phone string 选填 手机号
phone_prefix string 选填 手机号区号
accepts_marketing int 选填 邮件订阅状态。1 = 接受营销邮件,2 = 拒绝营销邮件
note string 选填 客户备注
customervip_id int 选填 会员等级 ID。传空字符串 "" 表示不修改
payafteruse_status int 选填 先用后付状态。1 = 先用后付客户,2 = 非先用后付客户
payafteruse_level int 选填 先用后付额度等级

请求示例

cURL

curl --location --request POST '{your-site-url}/api/skill/customer/update-customer' \
--header 'skill-access-token: {your-skill-access-token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": 574,
    "first_name": "yunlong2",
    "last_name": "li1",
    "phone": "+1 565689891",
    "accepts_marketing": 1,
    "payafteruse_status": 2,
    "payafteruse_level": 1
}'

返回结果

code200 表示调用成功;code 不为 200 表示调用失败。

成功响应

{
    "code": 200,
    "data": {
        "id": 574,
        "shop_id": 15,
        "email": "liyunlong@pingan2.com",
        "first_name": "yunlong2",
        "last_name": "li1",
        "note": "",
        "phone": "+1 565689891",
        "created_at": "2026-05-25 11:35:16",
        "updated_at": "2026-05-25 11:37:57",
        "accepts_marketing": 1,
        "customervip_id": 0
    },
    "message": "success"
}

返回字段说明

字段 类型 说明
code Number 状态码,200 表示成功
message String 执行结果的文字描述
data Object 更新后的客户详情

data 子字段

字段 类型 说明
id int 客户 ID
shop_id int 店铺 ID
email string 客户邮箱(不可更新,仅返回当前值)
first_name string
last_name string
note string 客户备注
phone string 手机号
accepts_marketing int 邮件订阅状态。1 = 接受营销邮件,2 = 拒绝营销邮件
customervip_id int 会员等级 ID
created_at string 创建时间
updated_at string 更新时间(更新成功后自动刷新)

注意事项

  1. id 为必填,其余字段均为选填
  2. 只传需要修改的字段即可,未传的字段保持原值不变
  3. emailstatus 不可通过此接口更新
  4. customervip_id 传空字符串 "" 时不会被修改
  5. payafteruse_statuspayafteruse_level 仅在安装了先用后付插件时有效
Copyright © fecify.com 2025 all right reserved,powered by Gitbook该文件修订时间: 2026-05-25 12:00:31

results matching ""

    No results matching ""