Skip to main content

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&params[period]=this_month&params[limit]=50' \
--header 'X-API-KEY: <API-KEY>' \
--header 'Cookie: <Session-Cookie>' \
--data ''

Response Structure:

  • JSON includes:
    • data: list containing:
      • labels: list of user names
      • series: includes two groups:
        • new_account: list of new customer counts
        • account_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 and account_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.