Skip to main content

By Customer Group

Endpoint:

GET https://yourdomain.com/api/v6.1/account_report/customer_portrait_pie

Request Headers:

  • X-API-KEY: <API-KEY>
  • Cookie: <Session-Cookie>

Request Parameters:

  • fields (required):
    • quantity_account_type_pie
  • params[period] (optional):
    • this_month (current month)
  • params[limit] (optional):
    • 50 (record limit)

CURL Request Example:

curl --location --globoff 'https://yourdomain.com/api/v6.1/account_report/customer_portrait_pie?fields=quantity_account_type_pie&params[period]=this_month&params[limit]=50' \
--header 'X-API-KEY: <API-KEY>'

Response Structure:

  • JSON includes:
    • data: an array, where each element is a list of objects including:
      • label: customer group name
      • value: number of customers

JSON Response Example:

{
"data": [
[
{"label": "Group A", "value": 5000},
{"label": "Group B", "value": 300},
{"label": "Group C", "value": 150},
{"label": "Group D", "value": 100},
{"label": "Group E", "value": 50},
{"label": "Other Group", "value": 200}
]
]
}

Note:

  • Results categorize customers by group type.
  • value indicates the number of accounts belonging to each group.
  • The "No customer group" group is often the highest percentage group and needs attention.

Purpose of Use:

  • Draw a pie chart showing the distribution ratio.
  • Analyze the customer group structure.
  • Identify uncategorized groups for further action.