Update Customer
1. Overview
This API is used to update customer information in the CRM system.
- Endpoint:
/api/v6.1/account
- Method:
PUT
- Authentication:
X-API-KEY
must be sent in the header
2. Request
2.1. Headers
Tên | Loại | Mô tả |
---|---|---|
X-API-KEY | String | API Key for authentication |
Content-Type | String | application/json |
2.2. Body Parameters
Field | Type | Description |
---|---|---|
current_account_code | string | Current customer code to update |
account_code | string | New customer code (if changed) |
email | string | Customer email |
billing_address_street | string | Customer address |
phone_office | string | Office phone number |
last_contact_name | string | Last contact name |
last_contact_phone | string | Last contact phone number |
last_contact_email | string | Last contact email |
last_contact_title | string | Last contact title |
last_contact_birthdate | string | Last contact birthdate (YYYY-MM-DD) |
website | string | Customer's website |
account_name | string | Customer name |
birthday | string | Customer's birthday (YYYY-MM-DD) |
description | string | Customer description |
sic_code | string | Customer tax code |
publisher_code | string | Creator code |
is_private | integer | 1: Private, 0: Public |
is_create_care | integer | 1: Create care, 0: No |
referrer_type | string | Referrer type |
referrer_ref_code | string | Referrer code |
contacts | array | List of contacts |
account_manager_username | string | Customer manager's username |
account_type_names | array | List of customer types |
account_source_names | array | List of customer sources |
industry_names | array | List of industries |
relation_name | string | Customer relationship |
country_name | string | Country |
province_name | string | Province/City |
district_name | string | District |
ward_name | string | Ward |
custom_fields | object | Custom data fields |
2.3. Request Example
curl --location --request PUT 'https://xxxx.getflycrm.com/api/v6.1/account' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: YOUR_API_KEY' \
--data-raw '{
"current_account_code":"KH_DEMO_12345",
"account_code": "KH_DEMO_12345",
"email": "[email protected]",
"billing_address_street": "123 ABC Street, XYZ District",
"phone_office": "0909123456",
"last_contact_name": "Nguyen Van A",
"last_contact_phone": "0912345678",
"last_contact_email": "[email protected]",
"last_contact_title": "Director",
"last_contact_birthdate": "1980-05-10",
"website": "https://example.com",
"account_name": "XYZ Co., Ltd.",
"birthday": "1985-07-20",
"description": "Potential customer",
"sic_code": "123456789",
"publisher_code": "PUB12345",
"is_private": 1,
"is_create_care": 1,
"referrer_type": "USER",
"referrer_ref_code": "referrer_abc",
"contacts": [
{
"first_name": "Tran Thi B",
"title": "Secretary",
"phone_home": "0987654321",
"birthdate": "1992-03-15",
"email": "[email protected]",
"gender_name": 2,
"description": "Primary contact",
"is_primary": 1
}
],
"account_manager_username": "manager_xyz",
"account_type_names": [
"VIP Customer",
"Large Enterprise"
],
"account_source_names": [
"Google Ads",
"Facebook Marketing"
],
"industry_names": [
"Technology",
"Real Estate"
],
"relation_name": "Partner",
"country_name": "Vietnam",
"province_name": "Hanoi",
"district_name": "Ba Dinh",
"ward_name": "Kim Ma Ward",
"custom_fields": {
"Order_Code": "ORDER12345"
}
}'
3. Response
3.1. JSON Response Structure
{
"message": "Update successful",
"data": {
"account_id": 12345,
"account_code": "KH_DEMO_12345"
}
}
3.2. Description of Returned Data Fields
Field | Type | Description |
---|---|---|
message | string | Result message |
data | object | Updated customer information |
data.account_id | integer | Customer ID |
data.account_code | string | Customer code |
4. Notes
- The API requires authentication using
X-API-KEY
. - Data fields must be in the correct format to avoid errors.
- The
current_account_code
must match an existing customer to update.
This document provides detailed information about the API for updating customers, making it easy to integrate into the system.