需要 write_customers 权限点。
更多权限点使用信息,请参考:
PUT https://{handle}.myshopline.com/admin/openapi/v20220901/customers/:id.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
更新顾客
路径参数
  • id string required
    客户id
    Example: 4211465524
请求头
  • Content-Type required
    字段值固定为application/json; charset=utf-8
  • Authorization string required
    资源的访问令牌。请参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入
    Example:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
请求体
  • customerobject
    客户信息
  • accepts_marketing boolean
    是否订阅邮箱,修改订阅状态时用户邮箱必填
    Example: true
  • addressesobject[]
    客户地址列表 个数限制:50
  • address1 string
    地址1 长度限制:255
    Example: 7720 Cherokee Road
  • address2 string
    地址2 长度限制:255
    Example: Apartment 2
  • city string
    城市 长度限制:64
    Example: Hagerman
  • company string
    公司 长度限制:255
    Example: joyy
  • country string
    国家 长度限制:64
    Example: United States
  • country_code string
    国家编码 长度限制:50
    Example: US
  • country_name string
    用户的标准化国家/地区名称
    Example: United States
  • customer_id string
    客户id
    Example: 4201825054
  • default boolean
    是否默认地址
    Example: true
  • first_name string
    名称 长度限制:128
    Example: Bob
  • id string
    地址id
    Example: 207119551
  • last_name string
    姓 长度限制:128
    Example: Norman
  • name string
    用户昵称
    Example: NormanBob
  • phone string
    电话号码 长度限制:16
    Example: 008615834564475
  • province string
    省 长度限制:64
    Example: Kentucky
  • province_code string
    省编码 长度限制:50
    Example: KY
  • zip string
    邮政编码 长度限制:10
    Example: 40202
  • birthday string
    生日。格式:yyyyMMdd
    Example: 19970102
  • email string
    邮箱 长度限制:50
    Example: 123@qq.com
  • first_name string
    名称 长度限制:128
    Example: Bob
  • gender integer
    0:未知/未设置,1:男,2:女 ,3:保密/不公开
  • last_name string
    姓 长度限制:128
    Example: Norman
  • note string
    备注 长度限制:1000
    Example: Placed an order that had a fraud warning
  • phone string
    手机号 长度限制:20
    Example: 008615834564475
  • tags string
    标签,不同标签之间使用逗号分隔。单个标签限制100个字符,标签个数限制100,该字段总长度限制1000字符
    Example: loyal
响应
更多状态码信息请参考 HTTP 状态码

响应头
  • traceId
    traceId
响应体
  • customerobject
    客户详情
  • accepts_marketing boolean
    是否邮件订阅
    Example: true
  • accepts_marketing_updated_at string
    邮件订阅时间(格式见IOS8601)
    Example: 2022-05-31T15:32:46+08:00
  • accepts_mobile_marketing_updated_at string
    电话订阅时间(格式见IOS8601)
    Example: true
  • accepts_phone_marketing boolean
    是否接受电话营销
  • addressesobject[]
    地址信息列表
  • address1 string
    地址1
    Example: 7720 Cherokee Road
  • address2 string
    地址2
    Example: Apartment 2
  • city string
    城市
    Example: Hagerman
  • company string
    公司
    Example: joyy
  • country string
    国家
    Example: United States
  • country_code string
    国家编码
    Example: US
  • customer_id string
    客户id
    Example: 4201825054
  • default boolean
    是否默认地址
    Example: true
  • first_name string
    名称
    Example: Bob
  • id string
    地址id
    Example: 207119551
  • last_name string
    Example: Norman
  • phone string
    电话号码
    Example: 008615834564475
  • province string
    Example: Kentucky
  • province_code string
    省编码
    Example: KY
  • zip string
    邮政编码
    Example: 40202
  • asid string
    FB登录id
    Example: 481007156599455
  • created_at string
    创建时间(格式见IOS8601)
    Example: 2022-09-07T10:53:31+08:00
  • currency string
    币种
    Example: USD
  • default_addressobject
    默认地址
  • address1 string
    地址1
    Example: 7720 Cherokee Road
  • address2 string
    地址2
    Example: Apartment 2
  • city string
    城市
    Example: Hagerman
  • company string
    公司
    Example: joyy
  • country string
    国家
    Example: United States
  • country_code string
    国家编码
    Example: US
  • customer_id string
    客户id
    Example: 4201825054
  • default boolean
    是否默认地址
    Example: true
  • first_name string
    名称
    Example: Bob
  • id string
    地址id
    Example: 207119551
  • last_name string
    Example: Norman
  • phone string
    电话号码
    Example: 008615834564475
  • province string
    Example: Kentucky
  • province_code string
    省编码
    Example: KY
  • zip string
    邮政编码
    Example: 40202
  • email string
    邮件
    Example: 123@qq.com
  • email_subscribe_flag integer
    邮箱订阅状态 0:取消订阅,1:已订阅,2:未订阅
    Example: 1
  • first_name string
    用户昵称
    Example: Bob
  • id string
    客户id
    Example: 4201825054
  • last_name string
    姓氏
    Example: Norman
  • last_order_id string
    最近一笔订单号
    Example: 2005473211984312275741
  • mobile_subscribe_flag integer
    手机订阅状态 0:取消订阅,1:已订阅,2:未订阅
  • note string
    备注
    Example: Placed an order that had a fraud warning
  • orders_count long
    订单数量
    Example: 12
  • phone string
    手机号
    Example: 008615834564475
  • state integer
    客户状态【0 : 已禁用账户,1:待启用账户,2:已邀请账户,3:有效账户】
    Example: 2
  • tags string
    客户标签
    Example: loyal
  • total_spent string
    总花费金额
    Example: 100
  • updated_at string
    更新时间(格式见IOS8601)
    Example: 2022-09-07T10:53:31+08:00
  • verified_email boolean
    是否验证邮件
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20220901

ParamOptions

— path required
— header required

Body

required
{
  "customer": {
    "accepts_marketing": true,
    "addresses": [
      {
        "address1": "7720 Cherokee Road",
        "address2": "Apartment 2",
        "city": "Hagerman",
        "company": "joyy",
        "country": "United States",
        "country_code": "US",
        "country_name": "United States",
        "customer_id": "4201825054",
        "default": true,
        "first_name": "Bob",
        "id": "207119551",
        "last_name": "Norman",
        "name": "NormanBob",
        "phone": "008615834564475",
        "province": "Kentucky",
        "province_code": "KY",
        "zip": "40202"
      }
    ],
    "birthday": "19970102",
    "email": "123@qq.com",
    "first_name": "Bob",
    "gender": 0,
    "last_name": "Norman",
    "note": "Placed an order that had a fraud warning",
    "phone": "008615834564475",
    "tags": "loyal"
  }
}

Language

curl --request PUT \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20220901/customers/id.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
更新用户姓名
Request
{
"customer": {
"birthday": "19990304",
"email": "hqh0315@test.com",
"first_name": "修改",
"gender": 3,
"last_name": "用户0315",
"note": "Placedanorderthathadafraudwarning",
"phone": "0015834564475",
"tags": "loyal"
}
}
Response
{
"customer": {
"accepts_marketing": false,
"accepts_phone_marketing": false,
"addresses": [
{
"address1": "address1",
"address2": "address2",
"city": "Louisville",
"company": "company",
"country": "UnitedStates",
"country_code": "US",
"customer_id": "4211465524",
"default": true,
"first_name": "first_name",
"id": "SL201UA5702515980125086505",
"last_name": "last_name",
"phone": "5556251199",
"province": "Kentucky",
"province_code": "4200021",
"zip": "403210"
}
],
"created_at": "2022-12-05T15:15:47+08:00",
"currency": "USD",
"default_address": {
"address1": "address1",
"address2": "address2",
"city": "Louisville",
"company": "company",
"country": "UnitedStates",
"country_code": "US",
"customer_id": "4211465524",
"default": true,
"first_name": "first_name",
"id": "SL201UA5702515980125086505",
"last_name": "last_name",
"phone": "5556251199",
"province": "Kentucky",
"province_code": "4200021",
"zip": "403210"
},
"email": "hqh0315@test.com",
"email_subscribe_flag": 2,
"first_name": "修改",
"id": "4211465524",
"last_name": "用户0315",
"mobile_subscribe_flag": 2,
"note": "Placedanorderthathadafraudwarning",
"orders_count": 0,
"phone": "0015834564475",
"state": 1,
"tags": "loyal",
"total_spent": "0",
"updated_at": "2022-12-05T15:53:52+08:00",
"verified_email": false
}
}
这篇文章对你有帮助吗?

Error loading component.

Error loading component.