Get reseller analytics

The Get reseller analytics method is used to get information about the expenses per subscription of all reseller's customers. The target period can be specified using arbitrary dates only. 

An API token of a manager is required for authorization. To get an API token via the Operator Control Panel, see Viewing and updating Manager's information

The manager's API token specified in an API request determines:

  • The role and access level of the manager, which determine the availability of a method.
  • The current reseller and downstream resellers accessible within a method.

GET {base_url}/api/v3/resellers/{reseller_id}/reseller_analytics

Arguments

Name

Parameter Type

Data type

Required/ 
Optional

Description

X-Api-TokenheaderstringRequiredAPI token of a manager that performs the operation (see Viewing and updating Manager's information)
Content-TypeheaderstringRequiredMedia type of the request. Specify the following: application/vnd.api+json
AcceptheaderstringRequiredSupported media types of the answer. Specify the following: application/vnd.api+json
base_urlpathstringRequiredActivePlatform URL
reseller_idpathintegerRequiredThe reseller ID (see Viewing and updating Reseller general information)
date_fromquerystringRequiredThe first day of the target period (YYYY-MM-DD)
date_toquerystringRequiredThe last day of the target period (YYYY-MM-DD)

Response model

Name

Data type

Description

expensesarray of objectsA list of expenses

totalstringThe subscription expenses amount in the reseller currency

billing_periodstringThe billing period (YYYY-MM)

account_idintegerThe account ID

subscription_idintegerThe subscription ID

Request example

GET /api/v3/resellers/1/reseller_analytics?date_from=2023-09-01&date_to=2023-09-20
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json

Response example

{
    "expenses": [
        {
            "total": "25.76",
            "period": "2023-06",
            "account_id": 929,
            "subscription_id": 3008386
        },
        {
            "total": "437.0",
            "period": "2023-06",
            "account_id": 1195,
            "subscription_id": 3008458
        }
    ]
}