Skip to main content

Customer List

1. Overview

This API is used to retrieve a list of customers from the CRM system.

  • Endpoint: /api/v6/accounts
  • Method: GET
  • Authentication: X-API-KEY must be sent in the header

2. Request

2.1. Headers

NameTypeDescription
X-API-KEYStringAPI Key for authentication

2.2. Query Parameters

Data Filtering

The API supports multiple filters to search for customers based on specific criteria.

FieldOperatorTypeDescription
ideq, in, not_inintegerCustomer identifier
account_codeeq, containsstringCustomer code
account_nameeqstringCustomer name
relation_ideq, in, not_inintegerRelationship
phone_officeeq, containsnumericPhone number
emaileq, containsstringCustomer email
account_typeeq, in, not_instringCustomer type
account_sourceeq, instringCustomer source
industryeqstringRating
billing_address_streeteq, containsstringAddress
created_ateq, gte, lte, betweentimestampCreation date
updated_ateq, gte, lte, betweentimestampModification date
gendereqintegerGender
account_managereq, in, not_inintegerManager
sale_order_statuseq, inintegerOrder status

Data Sorting

FieldValue
idasc, desc
account_nameasc, desc
account_codeasc, desc
emailasc, desc

Pagination (Limit & Offset)

FieldTypeDescription
limitintegerNumber of records to retrieve
offsetintegerNumber of records to skip

3. Request & Response

3.1. Request Example

curl --location 'https://xxxx.getflycrm.com/api/v6/accounts?fields=id,account_code,account_name,email&limit=1' \
--header 'X-API-KEY: YOUR_API_KEY' \
--data ''

3.2. Response Example

{
"data": [
{
"id": 10001,
"account_code": "KH/2025/000001",
"account_name": "ABC Company",
"description": "Potential customer",
"billing_address_street": "123 XYZ Street, ABC City",
"phone_office": "0123456789",
"email": "[email protected]",
"website": "https://abc.com",
"created_at": "2025-02-25 09:12:32",
"updated_at": "2025-03-06 17:34:43",
"account_type": [1, 5],
"account_source": [3, 6],
"relation_id": 4,
"relation_name": "New customer",
"gender": 1,
"total_revenue": 500000,
"country_name": "Vietnam",
"province_id": 1,
"district_id": 3,
"ward_id": 86,
"industry": [2, 4],
"account_manager": 2,
"account_type_details": [
{"id": 1, "label": "Hype"},
{"id": 5, "label": "Difficult"}
],
"account_source_details": [
{"id": 3, "label": "Ladipage"},
{"id": 6, "label": "Self-sourced"}
],
"industry_details": [
{"id": 2, "label": "Garment"},
{"id": 4, "label": "Startup"}
],
"account_relation_detail": {"id": 4, "label": "Potential"},
"gender_detail": {"id": 1, "label": "Male"},
"country_detail": {"id": 1, "label": "Vietnam"},
"province_detail": {"id": 1, "label": "Hanoi"},
"district_detail": {"id": 3, "label": "Hai Ba Trung"},
"ward_detail": {"id": 86, "label": "Ward XYZ"}
}
],
"has_more": true,
"offset": 0,
"limited": 1,
"sorted": {"id": "DESC"}
}

Returned data in JSON format with full field descriptions:

FieldTypeDescription
idintegerCustomer identifier
account_codestringCustomer code
account_namestringCustomer name
descriptionstringDetailed customer description
billing_address_streetstringCustomer address
phone_officestringOffice phone number
emailstringCustomer email
websitestringCustomer's website
created_attimestampCustomer account creation date
updated_attimestampLast update date
account_typearrayList of customer types (ID)
account_sourcearrayList of customer sources (ID)
relation_idintegerCustomer relationship ID
relation_namestringCustomer relationship name
genderintegerCustomer gender (1: Male, 2: Female, 3: Other)
total_revenuenumericTotal customer revenue
country_namestringCustomer's country
province_idintegerProvince/City ID
district_idintegerDistrict ID
ward_idintegerWard ID
industryarrayList of industries (ID)
account_managerintegerCustomer manager ID
contactsarrayList of customer contact information
custom_fieldsobjectCustom information fields added by the system or user
account_type_detailsarrayDetails about customer types (ID & Name)
account_source_detailsarrayDetails about customer sources (ID & Name)
industry_detailsarrayDetails about customer industries (ID & Name)
account_relation_detailobjectDetailed information about customer relationship
gender_detailobjectDetailed information about customer gender
country_detailobjectCustomer's country details
province_detailobjectCustomer's province/city details
district_detailobjectCustomer's district details
ward_detailobjectCustomer's ward details

4. Notes

  • The API requires authentication using X-API-KEY.
  • Filters can be used to search for customers based on various criteria.
  • Default sorting is by id DESC, which can be changed using the sort parameter.

This document provides detailed information about the API for retrieving customer lists, making it easy to integrate into the system.