Get list of reseller charges of downstream resellers

The Get list of reseller charges of downstream resellers method returns the list of the reseller charges of all downstream resellers of the current reseller or any of its downstream resellers.

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 current reseller and downstream resellers accessible within a method.

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

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
AcceptheaderstringRequired

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

base_urlpathstringRequiredActivePlatform URL
reseller_idpathintegerRequiredID of the current reseller or any of its downstream resellers (see Viewing and updating reseller general information)
includequerystringOptional

Returns additional information about objects related to charges. The parameter can be a comma-separated list if information about several objects is required. The following objects and possible values are supported:

ObjectParameter value

Reseller

reseller

Account

account

Subscription

subscription

Plan

plan

Discount

discount

Plan resource

plan_resource

page[size]queryintegerOptionalPage navigation: number of elements per page. The default value is 50
page[number]queryintegerOptionalPage navigation: page number
account_typesquerystringOptionalFilters the list by an account type (see Account types). It is possible to specify several account types separated by a comma
plan_class_idsquerystringOptionalFilters the list by a service term ID (see Viewing the list of service terms). It is possible to specify several service term IDs separated by a comma
date_fromquerystringOptional

Filters the list by the minimal close date (in the YYYY-MM-DD format) of the related end-customer charge or reseller charge of a downstream reseller. For the Prepay and Postpay models, a charge is included in the list if the close date of the related charge is greater than or equal to the specified date

date_toquerystringOptional

Filters the list by the maximal close date (in the YYYY-MM-DD format) of the related end-customer charge or reseller charge of a downstream reseller. For the Prepay and Postpay models, a charge is included in the list if the close date of the related charge is less than the specified date

billing_date

query

string

Optional

Filters closed charges by the start date of the related billing period in the YYYY-MM-DD format

Response model

Name

Data type

Description

dataarrayResponse data


id

stringID of the charge

typestringData type

attributesobjectInformation about the charge


created_atstringDate and time of the charge creation


updated_atstringDate and time when the charge was updated


charge_idinteger

ID of the linked charge:

  • ID of the end-customer charge closing of which caused generation of the reseller charge.
  • ID of the reseller charge of the downstream reseller creation of which caused generation of the reseller charge.


subscription_idintegerID of the customer's subscription


unit_pricestringThe unit price of the service or resource in the plan currency


amountstringThe amount of the charge (discount included) in the reseller currency


net_coststring
  • For a reseller charge not linked to a reseller charge of the upstream reseller — the net cost of the charge in the upstream reseller currency calculated as follows:

    net_cost = cost × duration × quantity × net_cost_currency_rate / net_cost_currency_unit

    where cost is the net cost of a resource or period in the plan for the corresponding charge type.

  • For a reseller charge linked to a reseller charge of the upstream reseller — the net cost of the charge in the currency of the second upstream reseller equal to the amount of the linked reseller charge.


net_cost_originalstring

The net cost of the charge in the plan currency:

  • For a reseller charge not linked to a reseller charge of the upstream reseller — calculated as follows:

    net_cost_original = cost × duration × quantity

    where cost is the net cost of a resource or period in the plan for the corresponding charge type.

  • For a reseller charge linked to a reseller charge of the upstream reseller — calculated as follows:

    net_cost_original = amount × net_cost_currency_unit / net_cost_currency_rate

    where amount is the amount of the linked reseller charge in the currency of the second upstream reseller.



net_cost_currency_ratestring
  • For a reseller charge not linked to a reseller charge of the upstream reseller — the exchange rate from the upstream reseller currency to the plan currency set on the upstream reseller level and used to calculate the charge net cost.
  • For a reseller charge linked to a reseller charge of the upstream reseller — the exchange rate from the currency of the second upstream reseller to the plan currency set on the level of the second upstream reseller and used to calculate the charge net cost.


net_cost_currency_unitinteger
  • For a reseller charge not linked to a reseller charge of the upstream reseller — the currency units used for the exchange rate set on the upstream reseller level to calculate the charge net cost.
  • For a reseller charge linked to a reseller charge of the upstream reseller — the currency units used for the exchange rate set on the level of the second upstream reseller to calculate the charge net cost.


subscription_resource_idintegerID of the resource in the customer's subscription


subscription_resource_namestringName of the resource in the customer's subscription


plan_resource_idintegerName of the resource in the customer's plan


resource_idintegerID of the resource


quantitynumberThe number of ordered services or resources


operate_from

stringThe start date of the period paid by the charge (YYYY-MM-DD)


operate_tostringThe finish date of the period paid by the charge (YYYY-MM-DD)


durationnumberPeriod of the charge (in months). For example, 1 day = 0.033, 2 years = 24


descriptionstringCharge details description


typestring

Type of the charge (see also Charges attributes)

  • Charge::Setup — a non-recurring charge for service setup.
  • Charge::Recurring — a monthly charge for service usage.
  • Charge::RecurringResource — a monthly charge for resource usage.
  • Charge::Renewal — a non-recurring charge for service renewal.
  • Charge::RenewalResource — a non-recurring charge for resource renewal.
  • Charge::ExternalResource — an accumulative charge based on the consumed resources records.
  • Charge::SetupResource — a non-recurring charge for resource setup.
  • Charge::Transfer — a non-recurring charge for subscription transfer.


order_idintegerID of the order


application_template_keystringKey of the application template linked to the subscription (see Viewing and updating connector details)


additional_paramsarray of objects

Additional parameters of the charge for services based on the following plugins:

  • MicrosoftCspProducts:

    NameData typeDescription
    tenant_idstringTenant ID in Microsoft Partner Center
    tenant_namestringTenant name (domain) in Microsoft Partner Center
    subscription_idstringSubscription ID on the Microsoft side (external ID)
    order_idstringOrder ID on the Microsoft side
    alternate_idstringAlternate order ID on the Microsoft side
    product_idstringMicrosoft Product ID of a resource linked to the charge (for an example, see Fetching the list of resources for the Microsoft Software Subscriptions service)
    sku_idstringSKU of a resource on the Microsoft side linked to the charge (for an example, see Fetching the list of resources for the Microsoft Software Subscriptions service)
    term_durationstringTerm Duration of a subscription on the Microsoft side. For example, P1M or P1Y
    billing_cyclestringBilling Cycle of a subscription on the Microsoft side. For example, Monthly or Annual
    attribute_typestring

    Information about the purpose of the charge for subscriptions to the Microsoft Azure Plan service (see Resource consumption records for the Microsoft Azure Plan service):

    • azure_plan — basic consumption within the Microsoft Azure Plan subscription.
    • azure_ri — reserved resources (Azure RI).
    • 3rd_party — third-party resources.
    effective_costnumberThe net cost of the charge for the reseller with the applied PEC discount from Microsoft. Only for subscriptions to the Microsoft Azure Plan service (see Resource consumption records for the Microsoft Azure Plan service)
  • Manual Provisioning Plugin:

    NameData typeDescription
    tenant_namestringPrimary name of the account ordered the subscription (see Get account)
    tenant_idstringID of the account ordered the subscription
    order_idstringID of the sales order linked to the subscription
    subscription_idstringSubscription ID
    offer_idstringSKU of the Plan linked to the subscription (see Get plan)
  • Office365:

    NameData typeDescription
    tenant_namestringTenant name (domain) in Microsoft Partner Center
    tenant_idstringTenant ID in Microsoft Partner Center
    order_idstringOrder ID on the Microsoft side
    subscription_idstringSubscription ID on the Microsoft side
    offer_idstringPlan SKU or Addon SKU in Microsoft Partner Center
  • Vendor Service Plugin (VSP):

    NameData typeDescription
    external_idstringApplication External ID
    plan_skustringPlan SKU
    subscription_attributesobjectSubscription attributes created in Vendor Portal (the password attribute excluded)
    resource_keystringApplication Resource Key
    attribute_typestring

    Information about the purpose of the charge:

    effective_costnumberThe net cost of the final charge for the reseller. Only for subscriptions to the Google Cloud Platform service (see Resource consumption records for the Google Cloud Platform service). The parameter is absent in other cases.

In other cases, returns the empty array




discountstringThe amount of the discount for the charge in the reseller currency


original_amountstring

The amount of the charge in the plan currency



original_amount_currencystringThe plan currency code for the charge amount


currency_ratestringThe exchange rate from the reseller currency to the plan currency set on the reseller level and used to calculate the charge amount


currency_unitintegerThe currency units used for the exchange rate set on the reseller level to calculate the charge amount


billing_datestringStart date of the related billing period (YYYY-MM-DD)


net_cost_original_currencystringThe plan currency code for the charge net cost

relationshipsobjectRelated objects


resellerobjectReseller information



dataobject

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


accountobjectAccount information



dataobject

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


subscriptionobjectSubscription information



dataobject

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


planobjectPlan information



dataobject

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


managerobjectManager information



dataobject

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


plan_resourceobjectPlan resource information



dataobject

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


discountobjectDiscount information



dataobject

Related object information:

NameData typeDescription
idstringID of the object
typestringData type
includedarray

Additional information about objects listed in the request:

NameData typeDescription
idstringID of the object
typestringData type
attributesobjectAttributes of the object (see details below)

Attributes of the object:

NameData typeDescription
idintegerID of the subscription
typestringData type
attributesobjectSubscription details

created_atstringDate and time of the subscription creation

updated_atstringDate and time when the subscription was updated

auto_renewalbool

The automatic subscription renewal option:

  • true — the automatic subscription renewal is enabled.
  • false — the automatic subscription renewal is off.

billing_fromstringThe start date of generating charges for the subscription (YYYY-MM-DD)

expiration_datestringThe expiration date of the subscription (YYYY-MM-DD)

namestringName of the subscription 

auto_renew_point_daysinteger

Auto-renew point (in days)


start_datestringThe date of activation of the subscription (YYYY-MM-DD)

statusstring

Status of the subscription (for the list of subscription statuses, see Viewing the list of resellers subscriptions)


payment_modelstring

Subscription payment model:

  • prepay
  • postpay

payment_model_parametersobjectPayment model parameters


credit_limitnumberThe value of the subscription debt, above which the postpaid subscription will be stopped. For postpaid subscriptions only (payment_model = postpay)


current_debtnumberThe subscription debt that is calculated as the total amount of all blocked charges for the subscription for the current billing period. For postpaid subscriptions only (payment_model = postpay)
  • For a plan, see the data model in Get plan.
  • For a discount:
NameData typeDescription
idstringID of the discount
typestringData type
attributesobjectDiscount details

created_atstringDate and time of the discount creation

updated_atstringDate and time when the discount was updated

namestringDiscount name

statusstring

Discount status:

  • active — discount is available for new orders.
  • inactive — discount is not available for new orders.

typestringDiscount type (for discount types, see Managing discounts)

percentagestringDiscount amount as a percentage

duration_fromstringStart date of the discount period (YYYY-MM-DD)

duration_tostringEnd date of the discount period (YYYY-MM-DD)
  • For a plan resource:
NameData typeDescription
idstringID of the resource in the plan
typestringData type
attributesobjectInformation about the resource

created_atstringDate and time of the resource creation

updated_atstringDate and time when the resource was updated

namestringName of the resource

measurablebool

Displays whether the actual amount of the used resource is supported:

  • true — the actual amount of the used resource is used for generating charges.
  • false — the actual amount of the used resource is not used for generating charges.

unit_of_measurestring

Unit of measure of the resource:

  • unit — the resource is measurable. The resource amount is specified.
  • boolean — the resource is non-measurable. The resource amount is not required and:
    • true — the resource is included in the plan.
    • false — the resource is not included in the plan.

application_template_namestringName of the application template

includedinteger

Amount of the resource included in the plan by default (included resources are part of the subscription price)


minimuminteger

Minimum amount of the resource (together with the included amount) available for ordering (see Plan Resources)


limitinteger

Maximum amount of the resource available for ordering. For an unlimited resource (unlimited_units = true), limit = 0


setup_feestring

Setup fee of the resource


recurring_feestring

Monthly recurring fee of the resource


overuse_feestring

Overuse fee of the resource


renewal_feestring

Renewal fee of the resource


unlimited_unitsbool

Attribute of the unlimited resource:

  • true — the resource is unlimited.
  • false — the resource is not unlimited.

publicbool

Availability of the resource:

  • true — the resource is available for ordering.
  • false — the resource is not available for ordering.

statusstring

Status of the resource:

  • active
  • inactive
  • deleted

resource_idinteger

ID of the resource in the application template


priorityintegerPriority of the resource. For the main resource, priority is maximal

net_costsobject

The resource net costs in the plan



setup_feestring

Setup fee of the resource



recurring_feestring

Monthly recurring fee of the resource



overuse_feestring

Overuse fee of the resource



renewal_feestring

Renewal fee of the resource


custom_attributesobject

Information about custom attributes of the resource in the "key-value" pairs

linksobjectPage navigation links that use the defined page navigation parameters

selfstringCurrent page link

firststringFirst page link

prevstringPrevious page link

nextstringNext page link

laststringLast page link

Request example

GET /api/v3/resellers/357/child_reseller_reseller_charges?page[size]=2&page[number]=30
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json

Response example

{
    "data": [
        {
            "id": "11018",
            "type": "reseller_charges",
            "attributes": {
                "created_at": "2021-12-02T13:09:58.161+03:00",
                "updated_at": "2021-12-02T13:09:58.161+03:00",
                "charge_id": 118231,
                "subscription_id": 3009646,
                "unit_price": "50.0",
                "amount": "55.25",
                "net_cost": "0.0",
                "net_cost_original": "0.0",
                "net_cost_currency_rate": "1.3",
                "net_cost_currency_unit": 1,
                "subscription_resource_id": 42298,
                "subscription_resource_name": "non-rec",
                "plan_resource_id": 6797,
                "resource_id": 148924,
                "quantity": 1.0,
                "operate_from": "2021-12-02",
                "operate_to": "2022-03-01",
                "duration": 1.0,
                "description": "Upgrade resource (setup fee) \"non-rec\" for Subscription #3009646 \"Non-Recurring\"",
                "type": "Charge::Setup",
                "order_id": 16711,
                "application_template_key": "",
                "additional_params": [
                    {
                        "tenant_name": "Alena Check",
                        "tenant_id": 911,
                        "order_id": 16711,
                        "subscription_id": 3009646,
                        "offer_id": ""
                    }
                ],
                "discount": "9.75",
                "original_amount": "42.5",
                "original_amount_currency": "EUR",
                "currency_rate": "1.3",
                "currency_unit": 1,
                "billing_date": null,
                "net_cost_original_currency": "EUR"
            },
            "relationships": {
                "reseller": {
                    "data": {
                        "id": "359",
                        "type": "resellers"
                    }
                },
                "account": {
                    "data": {
                        "id": "911",
                        "type": "accounts"
                    }
                },
                "subscription": {
                    "data": {
                        "id": "3009646",
                        "type": "subscriptions"
                    }
                },
                "plan": {
                    "data": {
                        "id": "2164",
                        "type": "plans"
                    }
                },
                "plan_resource": {
                    "data": {
                        "id": "6797",
                        "type": "plan_resources"
                    }
                },
                "manager": {
                    "data": {
                        "id": "272",
                        "type": "managers"
                    }
                },
                "discount": {
                    "data": {
                        "id": "115",
                        "type": "discounts"
                    }
                }
            }
        },
        {
            "id": "10984",
            "type": "reseller_charges",
            "attributes": {
                "created_at": "2021-12-03T10:34:30.922+03:00",
                "updated_at": "2021-12-03T10:34:30.922+03:00",
                "charge_id": 118077,
                "subscription_id": 3009626,
                "unit_price": "50.0",
                "amount": "110.5",
                "net_cost": "0.0",
                "net_cost_original": "0.0",
                "net_cost_currency_rate": "1.3",
                "net_cost_currency_unit": 1,
                "subscription_resource_id": 42216,
                "subscription_resource_name": "non-rec",
                "plan_resource_id": 6797,
                "resource_id": 148924,
                "quantity": 2.0,
                "operate_from": "2021-12-03",
                "operate_to": "2022-03-02",
                "duration": 1.0,
                "description": "Upgrade resource (setup fee) \"non-rec\" for Subscription #3009626 \"Non-Recurring\"",
                "type": "Charge::Setup",
                "order_id": 16654,
                "application_template_key": "",
                "additional_params": [
                    {
                        "tenant_name": "Alena1 55555",
                        "tenant_id": 911,
                        "order_id": 16654,
                        "subscription_id": 3009626,
                        "offer_id": ""
                    }
                ],
                "discount": "19.50",
                "original_amount": "85.0",
                "original_amount_currency": "EUR",
                "currency_rate": "1.3",
                "currency_unit": 1,
                "billing_date": null,
                "net_cost_original_currency": "EUR"
            },
            "relationships": {
                "reseller": {
                    "data": {
                        "id": "359",
                        "type": "resellers"
                    }
                },
                "account": {
                    "data": {
                        "id": "911",
                        "type": "accounts"
                    }
                },
                "subscription": {
                    "data": {
                        "id": "3009626",
                        "type": "subscriptions"
                    }
                },
                "plan": {
                    "data": {
                        "id": "2164",
                        "type": "plans"
                    }
                },
                "plan_resource": {
                    "data": {
                        "id": "6797",
                        "type": "plan_resources"
                    }
                },
                "manager": {
                    "data": {
                        "id": "272",
                        "type": "managers"
                    }
                },
                "discount": {
                    "data": {
                        "id": "115",
                        "type": "discounts"
                    }
                }
            }
        }
    ],
    "links": {
        "self": "https://test.activeplatform.com/api/v3/resellers/357/child_reseller_reseller_charges?page%5Bnumber%5D=30&page%5Bsize%5D=2",
        "first": "https://test.activeplatform.com/api/v3/resellers/357/child_reseller_reseller_charges?page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "prev": "https://test.activeplatform.com/api/v3/resellers/357/child_reseller_reseller_charges?page%5Bnumber%5D=29&page%5Bsize%5D=2",
        "next": "https://test.activeplatform.com/api/v3/resellers/357/child_reseller_reseller_charges?page%5Bnumber%5D=31&page%5Bsize%5D=2",
        "last": "https://test.activeplatform.com/api/v3/resellers/357/child_reseller_reseller_charges?page%5Bnumber%5D=31&page%5Bsize%5D=2"
    }
}