Customer Ratio by User
Endpoint:
GET https://yourdomain.com/api/v6.1/account_report/customer_portrait_bar
Request Headers:
X-API-KEY: <API-KEY>
Cookie: <Session-Cookie>
Request Parameters:
fields
(required):account_purchase_rate_bar
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_bar?fields=account_purchase_rate_bar¶ms[period]=this_month¶ms[limit]=50' \
--header 'X-API-KEY: <API-KEY>' \
--header 'Cookie: <Session-Cookie>' \
--data ''
Response Structure:
- JSON includes:
data
: list containing:labels
: list of user namesseries
: includes two groups:new_account
: list of new customer countsaccount_has_order
: list of customer counts who have made purchases
JSON Response Example:
{
"data": [
{
"labels": [
"Nguyen Van A",
"Nguyen Van B"
],
"series": {
"new_account": [
{"label": "New customer", "value": 2},
{"label": "New customer", "value": 19}
],
"account_has_order": [
{"label": "Customer has purchased", "value": 0},
{"label": "Customer has purchased", "value": 2}
]
}
}
]
}
Note:
labels
is the list of objects to monitor.new_account
andaccount_has_order
help distinguish between total new customers and the number of successful customers.
Purpose of Use:
- Draw a bar chart comparing the number of new customers and purchased customers.
- Analyze customer conversion rates by group.
- Evaluate marketing and sales effectiveness.