Tạo & Cập nhật khách hàng

HTTP request

Example Request

curl --location 'https://api.service.ladiflow.com/1.0/customer/update' \
--header 'Api-Key: {{API_KEY}}' \
--data-raw '{
    "email": "test@gmail.com",
    "first_name": "test",
    "full_name": "test",
    "dob": "1989-11-03",
    "phone": null,
    "gender": "male",
    "tags": ["5fffb9c981cf1245fa091985", "5fffb9ce81cf1245fa091986", "5fffb9ce81cf1245fa091900"],
    "custom_fields": [
        {
        "name": "ldp_pkg_name",
        "value": "LADIPAGE-PRO"
        },
        {
        "name": "ldp_pkg_name1",
        "value": "LADIPAGE-PRO"
        }
    ],
    "city": "Hà Nội",
    "address": "68 Nguyễn Cơ Thạch",
    "address_2":"",
    "district": "Nam Từ Liêm",
    "company": "LadiPage",
    "job_title": "Coder",
    "ward": "Mỹ Đình 1",
    "lang": "vi",
    "postal_code": 100000,
    "source": "API",
    "external_customer_id": "123",
    "subcribed_at": "2020-12-01",
    "website": "123",
    "facebook_url": "123",
    "twitter_url": "123",
    "linkedIn_url": "123",
    "score": 14,
    "skype": null,
    "zalo": null
}'

Tham số header

Tham sốKiểu dữ liệuBắt buộcMô tả

Api-Key

string

API key lấy trên LadiFlow

Tham số Body

Tham sốKiểu dữ liệuBắt buộcMô tả

email

string

Bắt buộc email hoặc số điện thoại

_id

string

ID của khách hàng

first_name

string

Tên

full_name

string

Họ và tên

dob

yyyy-mm-dd

Ngày sinh

phone

string

Số điện thoại Bắt buộc email hoặc số điện thoại

gender

male/female

Giới tính

tags

list

Import_by_tag_name= true thì Cần điền danh sách tên tag muốn gán Import_by_tag_name=false thì Cần điền danh sách tag id muốn gán

import_by_tag_name

boolean

True: Thêm tag cho khách hàng bằng name False: thêm tag cho khách hàng bằng id

custome_fields

List Object

Các giá trị trường tuỳ chỉnh

country

string

Quốc gia

city

string

thành phố

district

string

Quận huyện

ward

string

Phường xã

address

string

Địa chỉ

company

string

Tên công ty

job_title

string

Công việc

lang

vi/en/other

Ngôn ngữ

postal_code

number

Mã bưu điện

channels

list

Kênh tương tác

external_customer_id

string

ID khách hàng từ dữ liệu bên ngoài

website

list

facebook_url

string

Đường dẫn tài khoản Facebook

twitter_url

string

Đường dẫn tài khoản Twitter

linkedIn_url

string

Đường dẫn tài khoản Linkedln

score

number

Điểm lead scoring

zalo

string

Tên zalo

skype

string

Tên tài khoản Skype

Example response

{
    "data": {
        "channels": [
            "API"
        ],
        "tags": [],
        "vouchers": [],
        "is_email_verified": false,
        "messenger_recurring_message_tokens": [],
        "messenger_recurring_topics": [],
        "fb_page_ids": [],
        "fb_uids": [],
        "zalo_oa_ids": [],
        "zalo_uids": [],
        "ladichat_uids": [],
        "ladichat_store_ids": [],
        "is_merge": false,
        "is_delete": false,
        "_id": "653a3ca502e8ab00122c39c3",
        "email": "test@gmail.com",
        "key": "test@gmail.com-5f9fa8a09b5c4d6ce6e3a77d",
        "custom_fields": [],
        "name": "test",
        "first_name": "test",
        "last_name": "",
        "gender": "male",
        "dob": "1989-11-03T00:00:00.000Z",
        "dob_year": 1989,
        "dob_month": 10,
        "dob_day": 3,
        "dob_month_day": "1003",
        "company": "LadiPage",
        "job_title": "Coder",
        "city": "Hà Nội",
        "district": "Nam Từ Liêm",
        "address": "68 Nguyễn Cơ Thạch",
        "ward": "Mỹ Đình 1",
        "postal_code": 100000,
        "website": "123",
        "facebook_url": "123",
        "twitter_url": "123",
        "linkedIn_url": "123",
        "alias": "testgmail-com-test",
        "status": "SUBSCRIBER",
        "subscribed_at": "2023-10-26T10:17:09.526Z",
        "external_customer_id": "123",
        "source": "API",
        "store_id": "5f9fa8a09b5c4d6ce6e3a77d",
        "owner_id": "5ebd77abdbd90818b28f8fce",
        "creator_id": "5ebd77abdbd90818b28f8fce",
        "avatar_color": "#0137D3",
        "score": 14,
        "fb_page_uids": [],
        "zalo_oa_uids": [],
        "ladichat_store_uids": [],
        "created_at": "2023-10-26T10:17:09.529Z",
        "updated_at": "2023-10-26T10:17:09.529Z",
        "isNewSubscriber": true,
        "external_data": [
            {
                "name": "full_name",
                "value": "test"
            },
            {
                "name": "lang",
                "value": "vi"
            },
            {
                "name": "subcribed_at",
                "value": "2020-12-01"
            },
            {
                "name": "owner_id",
                "value": "5ebd77abdbd90818b28f8fce"
            },
            {
                "name": "creator_id",
                "value": "5ebd77abdbd90818b28f8fce"
            },
            {
                "name": "is_delete",
                "value": false
            }
        ]
    },
    "message": "Thành công",
    "code": 201
}

Cấu trúc thuộc tính data

Thuộc tínhKiểu dữ liệuMô tả

data

Object

Dữ liệu khách hàng

message

string

Thông điệp

code

number

Mã phản hồi

Last updated