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. 

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

Authentication

This endpoint requires a JWT access token. Specify the token in the Authorization header using the Bearer authentication scheme:

Authorization: Bearer <JWT_ACCESS_TOKEN>

In Postman, select Bearer Token on the Authorization tab and enter the JWT access token.

Arguments

Name

Parameter Type

Data type

Required/ 
Optional

Description

Content-Type

header

string

Required

Media type of the request. Specify the following: application/vnd.api+json

Accept

header

string

Required

Supported media types of the answer. Specify the following: application/vnd.api+json

base_url

path

string

Required

ActivePlatform URL

reseller_id

path

integer

Required

The reseller ID (see Viewing and updating reseller general information)

date_from

query

string

Required

The first day of the target period (YYYY-MM-DD)

date_to

query

string

Required

The last day of the target period (YYYY-MM-DD)

Response model

Name

Data type

Description

expenses

array of objects

A list of expenses


total

string

The subscription expenses amount in the reseller currency


billing_period

string

The billing period (YYYY-MM)


account_id

integer

The account ID


subscription_id

integer

The subscription ID

Request example

XML
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
Authorization: Bearer <JWT_ACCESS_TOKEN>
Accept: application/vnd.api+json

Response example

JSON
{
    "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
        }
    ]
}