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-KEYmust be sent in the header
2. Request
2.1. Headers
| Name | Type | Description |
|---|---|---|
X-API-KEY | String | API Key for authentication |
2.2. Query Parameters
Data Filtering
The API supports multiple filters to search for customers based on specific criteria.
| Field | Operator | Type | Description |
|---|---|---|---|
id | eq, in, not_in | integer | Customer identifier |
account_code | eq, contains | string | Customer code |
account_name | eq | string | Customer name |
relation_id | eq, in, not_in | integer | Relationship |
phone_office | eq, contains | numeric | Phone number |
email | eq, contains | string | Customer email |
account_type | eq, in, not_in | string | Customer type |
account_source | eq, in | string | Customer source |
industry | eq | string | Rating |
billing_address_street | eq, contains | string | Address |
created_at | eq, gte, lte, between | timestamp | Creation date |
updated_at | eq, gte, lte, between | timestamp | Modification date |
gender | eq | integer | Gender |
account_manager | eq, in, not_in | integer | Manager |
sale_order_status | eq, in | integer | Order status |
Data Sorting
| Field | Value |
|---|---|
id | asc, desc |
account_name | asc, desc |
account_code | asc, desc |
email | asc, desc |
Pagination (Limit & Offset)
| Field | Type | Description |
|---|---|---|
limit | integer | Number of records to retrieve |
offset | integer | Number 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:
| Field | Type | Description |
|---|---|---|
id | integer | Customer identifier |
account_code | string | Customer code |
account_name | string | Customer name |
description | string | Detailed customer description |
billing_address_street | string | Customer address |
phone_office | string | Office phone number |
email | string | Customer email |
website | string | Customer's website |
created_at | timestamp | Customer account creation date |
updated_at | timestamp | Last update date |
account_type | array | List of customer types (ID) |
account_source | array | List of customer sources (ID) |
relation_id | integer | Customer relationship ID |
relation_name | string | Customer relationship name |
gender | integer | Customer gender (1: Male, 2: Female, 3: Other) |
total_revenue | numeric | Total customer revenue |
country_name | string | Customer's country |
province_id | integer | Province/City ID |
district_id | integer | District ID |
ward_id | integer | Ward ID |
industry | array | List of industries (ID) |
account_manager | integer | Customer manager ID |
contacts | array | List of customer contact information |
custom_fields | object | Custom information fields added by the system or user |
account_type_details | array | Details about customer types (ID & Name) |
account_source_details | array | Details about customer sources (ID & Name) |
industry_details | array | Details about customer industries (ID & Name) |
account_relation_detail | object | Detailed information about customer relationship |
gender_detail | object | Detailed information about customer gender |
country_detail | object | Customer's country details |
province_detail | object | Customer's province/city details |
district_detail | object | Customer's district details |
ward_detail | object | Customer'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 thesortparameter.
This document provides detailed information about the API for retrieving customer lists, making it easy to integrate into the system.