CRMKhách hàng

Cập nhật một phần khách hàng

Chỉ cập nhật các trường được gửi lên của một khách hàng.

Endpoint

PATCH /v1/customers/:id

Quyền: customer.manage

Path Parameters

TênKiểuBắt buộcMô tả
idintCóID khách hàng

Body Parameters

TênKiểuBắt buộcMô tả
company_idintCóID công ty
creator_idintCóID người thao tác

Ngoài 2 trường trên, chỉ cần gửi các trường muốn thay đổi. Các trường được hỗ trợ (ý nghĩa giống Cập nhật khách hàng):

customer_type_id, full_name, internal_name, internal_note, source, zalo_id, facebook_id, instagram_id, tiktok_id, shopee_id, telegram_id, gender, birthday, email, phone, address, region_id, sub_region_id, sub_sub_region_id, salutation, address_line_2, delivery_note, legacy_province_name, legacy_district_name, legacy_ward_name, avatar_file_id_list, note, price_policy_id, tax_buyer_name, tax_buyer_address, tax_buyer_phone, tax_buyer_email, tax_buyer_account_bank, tax_buyer_account_number, tax_buyer_tax_number, tag, ignore_auto_upgrade, is_company, group, group_status, group_moderator_id, group_moderator_note, representative_name, representative_id, representative_file_id_list, group_data.

Lưu ý

API PATCH không kiểm tra trùng mã / email / số điện thoại và không kiểm tra định dạng như PUT. Nên dùng PUT khi cần thay đổi code, email, phone hoặc birthday.

Ví dụ JSON

{
    "company_id": 10311,
    "creator_id": 1,
    "tag": "vip",
    "group": 1
}

Response Schema

HTTP 200 - JSON Object

Trả về object Customer đã cập nhật.

Error Codes

HTTPCodeMô tả
403error_role_not_availableKhông có quyền customer.manage
404error_not_foundKhông tìm thấy khách hàng
422error_company_id_requiredID công ty không được để trống
422error_company_id_notfoundID công ty không tìm thấy
422error_user1_id_requiredID người thao tác không được để trống
422error_user_id_notfoundID người thao tác không tìm thấy
422error_patch_list_emptyKhông có trường nào để cập nhật
500error_patchLỗi khi cập nhật

On this page