Skip to main content

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ênLoạiMô tả
X-API-KEYStringAPI Key for authentication
Content-TypeStringapplication/json

2.2. Body Parameters

FieldTypeDescription
current_account_codestringCurrent customer code to update
account_codestringNew customer code (if changed)
emailstringCustomer email
billing_address_streetstringCustomer address
phone_officestringOffice phone number
last_contact_namestringLast contact name
last_contact_phonestringLast contact phone number
last_contact_emailstringLast contact email
last_contact_titlestringLast contact title
last_contact_birthdatestringLast contact birthdate (YYYY-MM-DD)
websitestringCustomer's website
account_namestringCustomer name
birthdaystringCustomer's birthday (YYYY-MM-DD)
descriptionstringCustomer description
sic_codestringCustomer tax code
publisher_codestringCreator code
is_privateinteger1: Private, 0: Public
is_create_careinteger1: Create care, 0: No
referrer_typestringReferrer type
referrer_ref_codestringReferrer code
contactsarrayList of contacts
account_manager_usernamestringCustomer manager's username
account_type_namesarrayList of customer types
account_source_namesarrayList of customer sources
industry_namesarrayList of industries
relation_namestringCustomer relationship
country_namestringCountry
province_namestringProvince/City
district_namestringDistrict
ward_namestringWard
custom_fieldsobjectCustom 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

FieldTypeDescription
messagestringResult message
dataobjectUpdated customer information
data.account_idintegerCustomer ID
data.account_codestringCustomer 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.