顾客-创建

Customer Create Customer API 文档

接口信息

  • 接口地址: {your-site-url}/api/skill/customer/create-customer
  • 基础 URL: {your-site-url} 需替换为你自己的独立站 URL 地址,如 https://your-domain.com/apimanager666
  • 请求方式: POST
  • Content-Type: application/json
  • 说明: 此接口用于创建一个新客户

认证

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

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

请求参数 (JSON Body)

字段 类型 必填 说明
email string ✅ 必填 客户邮箱
first_name string ✅ 必填
last_name string ✅ 必填
phone string 选填 手机号
accepts_marketing int 选填 邮件订阅状态。1 = 接受营销邮件,2 = 拒绝营销邮件。默认 2
numberCode string 选填 手机号区号
payafteruse_status int 选填 先用后付状态。1 = 先用后付客户,2 = 非先用后付客户
payafteruse_level int 选填 先用后付额度等级

请求示例

cURL

curl --location --request POST '{your-site-url}/api/skill/customer/create-customer' \
--header 'skill-access-token: {your-skill-access-token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "last_name": "li",
    "first_name": "yunlong2",
    "email": "liyunlong@pingan2.com",
    "phone": "+1 565689891",
    "accepts_marketing": 1,
    "numberCode": "1",
    "payafteruse_status": 2,
    "payafteruse_level": 1
}'

返回结果

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

成功响应

{
    "code": 200,
    "data": {
        "shop_id": 15,
        "email": "liyunlong@pingan2.com",
        "first_name": "yunlong2",
        "last_name": "li",
        "status": 5,
        "note": "",
        "phone": "+1 565689891",
        "accepts_marketing": 1,
        "customervip_id": 0,
        "created_at": "2026-05-25 11:35:16",
        "updated_at": "2026-05-25 11:35:16",
        "id": 574
    },
    "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
status int 客户状态。5 = 后台创建待激活
note string 客户备注,初始为空
phone string 手机号
accepts_marketing int 邮件订阅状态。1 = 接受营销邮件,2 = 拒绝营销邮件
customervip_id int 会员等级 ID。新创建客户为 0
created_at string 创建时间
updated_at string 更新时间

注意事项

  1. emailfirst_namelast_name 为必填
  2. 后台创建的客户 status5(后台创建待激活状态)
  3. 新创建的客户 customervip_id 默认为 0note 为空
  4. payafteruse_statuspayafteruse_level 仅在安装了先用后付插件时有效
  5. 邮箱重复时会创建失败
Copyright © fecify.com 2025 all right reserved,powered by Gitbook该文件修订时间: 2026-05-25 11:37:37

results matching ""

    No results matching ""