HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Update Customer

Function

To update information for a specific customer
更新顧客資料

URL

PUT <<api_domain>>/v1/customers/:id

Request parameters

ParameterTypeDescriptionExample
nameStringCustomer's name
顧客姓名
"name": "Shopline User"
mobile_phoneStringCustomer Mobile Phone
顧客手機
-
*The '0' at the beginning of the phone number from TW was allowed to be skipped.
台灣電話號碼開首的'0'字可省略不輸入
"mobile_phone":"944384598"
mobile_phone_country_calling_code
*required if mobile_phone is not empty
StringCountry Code of Mobile Phone
手機號碼國碼
"mobile_phone_country_calling_code":"886"
phonesStringCustomer's phones, separate by comma if multiple
顧客電話, 以逗号分隔
"phones": "123456,123456,123456"
genderStringCustomer's Gender
顧客性別
-
Gender allows
male 男性
female 女性
other 其他
"gender": "male"
birthdayDateCustomer's birthday
顧客生日

*Will check age limit based on admin setting
將依據後台年齡限制檢查顧客生日
"birthday": "2016-01-01"
is_memberBooleanSet as registered customer
是否為會員

目前只支持將客戶轉成會員,不支援消息客戶會員。
"is_member": "true"
is_blacklistedBooleanSet as blacklisted
是否設定在黑名單
"is_member": "true"
membership_tier_idStringMembership Tier ID
會員等級ID
-
Please check
Get Membership
Tiers
"membership_tier_id": "5af400e9e38809776100002f"
delivery_addressesArrayCustomer's Delivery Addresss
顧客送貨地址
-
*Maximum for 5 delivery address groups
最多五組
"delivery_addresses":[{ "state": "Alabama", "city": "Taipei", "postcode": "10560", "address_1": "光復北路11巷44號14樓", "address_2": "松山區", "recipient_name": "marry", "recipient_phone": "0227423966", "country": "TW" }]
ref_user_idStringUser ID from third party
第三方顧客ID
"ref_user_id": "SL001"
memoString備註"memo": "顧客備註"
tagsString顧客標籤"tags": "Tags A,Tags B"
custom_fieldsHashCustom field content
顧客客製化欄位
-
You can check Get CustomFields to get the custom_field_id, and parameter
可於 Get CustomFields 拿到客製化欄位的ID與參數
"custom_fields": {"5a72fdb0e388097fac000008": "test_value" }

Request Example

curl -X PUT \
  <<api_domain>>/v1/customers/5ae6978d69702d04ad000000 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearar access_token' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Shopline User",
  "mobile_phone": "944384598",
  "mobile_phone_country_calling_code": "886",
  "phones": "02-27423586,0910000123",
  "gender": "male",
  "birthday": "2000-06-01",
  "memo": "memo by Grant",
  "tags": ["Tag A", "Tag C"],
  "is_member": "true",
  "is_blacklisted": "false",
  "membership_tier_id": "",
  "ref_user_id": "SL001",
  "custom_data": {
    "5a72fdb0e388097fac000008": "Test Value"
  }
}'

Response fields

The same as Get Customer

Response Example

The same as Get Customer

{
    "id": "606d4051c6febd0022d13447",
    "name": "Shopline User",
    "email": "[email protected]",
    "gender": "male",
    "birthday": "2000-06-01",
    "memo": "memo by Grant",
    "phones": [
        "02-27423586",
        "0910000123"
    ],
    "phone": "0910000123",
    "mobile_phone": "0944384598",
    "mobile_phone_verified": false,
    "mobile_phone_country_calling_code": "886",
    "locale_code": null,
    "order_count": 0,
    "orders_total_sum": {
        "cents": 0,
        "currency_symbol": "NT$",
        "currency_iso": "TWD",
        "label": "",
        "dollars": 0.0
    },
    "is_member": true,
    "is_blacklisted": false,
    "is_subscribed_marketing_email": true,
    "credit_balance": 0,
    "member_point_balance": 0,
    "custom_data": [],
    "membership_tier": null,
    "delivery_addresses": [
        {
            "city": "Taipei",
            "postcode": "10560",
            "address_1": "光復北路11巷44號14樓",
            "address_2": "松山區",
            "recipient_name": "marry",
            "recipient_phone": "0227423966",
            "country": "TW",
            "state": null,
            "key": null,
            "layer1": null,
            "layer2": null,
            "layer3": null,
            "district": null,
            "logistic_codes": null
        },
        {
            "city": "Taipei",
            "postcode": "10560",
            "address_1": "光復北路11巷44號14樓",
            "address_2": "松山區",
            "recipient_name": "marry",
            "recipient_phone": "0227423966",
            "country": "TW",
            "state": null,
            "key": null,
            "layer1": null,
            "layer2": null,
            "layer3": null,
            "district": null,
            "logistic_codes": null
        }
    ],
    "subscribed_email_types": [
        "marketing.news"
    ],
    "ref_user_id": "SL001",
    "line_id": null,
    "facebook_id": null,
    "updated_at": "2021-04-07T10:09:04.104+00:00",
    "created_at": "2021-04-07T05:17:05.406+00:00",
    "current_sign_in_at": null,
    "last_sign_in_at": null,
    "registered_at": "2021-04-07T05:17:05.368+00:00",
    "created_by": "mc",
    "tags": [
        "A",
        "C"
    ],
    "customer_authentication_linkings": [],
    "tier_expires_at": null
}