Get list of end-customer charges of downstream resellers

The Get list of end-customer charges of downstream resellers method returns the list of end-customers 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 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}/child_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)
page[size]queryintegerOptionalPage navigation: number of elements per page. The default value is 50
page[number]queryintegerOptionalPage navigation: page number
filter[close_date]querystringOptional

Filtering charges by the close date in the YYYY-MM-DD format. To specify the period, the following filters are used:

  • filter[close_date][gt] — close date is greater than the specified date.
  • filter[close_date][lt] — close date is less than the specified date.

filter[subscription_id]

query

integer

OptionalFiltering charges by the subscription ID

filter[status]

query

string

OptionalFiltering charges by the status (for the list of charge statuses, see Charges attributes)
filter[created_at]

query

string

Optional

Filtering charges by the date and time of the charge creation in the YYYY-MM-DDTHH:MM:SS format for the platform time zone or in the specified time zone (for example, YYYY-MM-DDTHH:MM:SSZ for UTC, see RFC 3339). To specify the period, the following filters are used:

  • filter[created_at][gt] — date and time are greater than the specified.
  • filter[created_at][lt] — date and time are less than the specified.
filter[updated_at]

query

string

Optional

Filtering charges by the date and time when the charge was updated in the YYYY-MM-DDTHH:MM:SS format for the platform time zone or in the specified time zone (for example, YYYY-MM-DDTHH:MM:SSZ for UTC, see RFC 3339). To specify the period, the following filters are used:

  • filter[updated_at][gt] — date and time are greater than the specified.
  • filter[updated_at][lt] — date and time are less than the specified.
filter[billing_date]

query

string

Optional

Filtering closed charges by the start date of the related billing period in the YYYY-MM-DD format
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
Taxestaxes

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


subscription_idintegerID of the customer's subscription


subscription_resource_idintegerID of the resource in the customer's subscription


operate_from

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


descriptionstringCharge details description


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


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


statusstringStatus of the charge (for the list of charge statuses, see Charges attributes)


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.


net_coststring
  • For plans created on the reseller level — the net cost of the charge in the 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 delegated plans — the net cost of the charge in the upstream reseller currency equal to the amount of the linked reseller charge.

If the charge is not closed, net_cost = null



tax_is_calculated_usingstring

The Tax is calculated using option in the system settings at the moment of the charge creation (see Taxes calculation settings):

  • net_prices — Plan prices without tax included — prices in the plan do not include taxes.
  • gross_prices — Plan prices with tax included — prices in the plan include taxes.


net_amountstringThe amount of the charge (taxes excluded) in the reseller currency


taxes_amountstringThe amount of taxes for the charge in the reseller currency


net_cost_originalstring

The net cost of the charge in the plan currency:

  • For plans created on the reseller level — 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 delegated plans — 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 upstream reseller currency.

If the charge is not closed, net_cost_original = null



net_cost_currency_ratestring
  • For plans created on the reseller level — the exchange rate from the reseller currency to the plan currency set on the reseller level and used to calculate the charge net cost.
  • For delegated plans — 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.


net_cost_currency_unitinteger
  • For plans created on the reseller level — the currency units used for the exchange rate set on the reseller level to calculate the charge net cost.
  • For delegated plans — the currency units used for the exchange rate set on the upstream reseller level to calculate the charge net cost.


unit_price_currencystringThe plan currency code for the unit price


quantitynumberThe number of ordered services or resources


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


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


order_idintegerID of the order


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


close_datestring

The close date of the charge (YYYY-MM-DD)



billing_datestringStart date of the billing period related to a closed charge (YYYY-MM-DD)


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:

  • Manual Provisioning Plugin:

    NameData typeDescription
    tenant_namestringThe primary name of the account ordered the subscription (see Get account)
    tenant_idstringThe ID of the account ordered the subscription
    order_idstringThe ID of the sales order linked to the subscription
    subscription_idstringThe subscription ID
    offer_idstringThe SKU of a plan linked to the subscription (see Get plan)
  • Office365:

    NameData typeDescription
    tenant_namestringThe Tenant name (domain) in Microsoft Partner Center
    tenant_idstringThe Tenant ID in Microsoft Partner Center
    order_idstringThe order ID on the Microsoft side
    subscription_idstringThe subscription ID on the Microsoft side
    offer_idstringThe Plan SKU or Addon SKU in Microsoft Partner Center
  • Vendor Service Plugin (VSP):

    NameData typeDescription
    external_idstringThe External ID of an application
    plan_skustringThe plan SKU
    subscription_attributesobjectSubscription attributes created in Vendor Portal (the password attribute excluded)
    resource_keystringThe key of an application resource
    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 an 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


net_cost_original_currencystringThe plan currency code for the charge net cost

relationshipsobject

Related objects

  • Reseller charges are simultaneously related to the parent plan and the subscription plan resource.
  • When switching a subscription plan, old charges of the subscription and new charges for a refund remain related to the old plan and its resources. All other new charges will be related to the new plan and its resources.



taxesobjectTaxes information



dataarray of objects

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


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


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
idstringID 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 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 every tax used to calculate the charge:

    НазваниеТип данныхОписание
    idstringThe tax ID
    typestringData type
    attributesobjectTax details

    created_atstringDate and time of the tax creation

    updated_atstringDate and time when the tax was updated

    charge_idintegerThe ID of the related charge

    origin_idintegerThe tax ID in the taxation module

    namestringThe tax name

    codestringThe tax code

    ratenumberThe tax rate percentage

    amountstringThe tax amount in the reseller currency calculated for net_amount of the charge
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
metaobjectAdditional information about the charge

currencystringReseller's currency code

Request example

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

Response example

{
    "data": [
        {
            "id": "4330",
            "type": "charges",
            "attributes": {
                "created_at": "2022-12-19T08:15:36.288637+0000",
                "updated_at": "2023-02-10T03:56:16.007317+0000",
                "subscription_id": 950,
                "subscription_resource_id": 1007,
                "operate_from": "2022-12-19",
                "description": "Upgrade resource (recurring fee) \"Licenses\" for Subscription #950 \"Office\"",
                "unit_price": "10.0",
                "amount": "41.9",
                "status": "closed",
                "type": "Charge::Recurring",
                "net_cost": "41.9",
                "net_amount": "29.1",
                "taxes_amount": "12.8",
                "net_cost_original": "41.9",
                "net_cost_currency_rate": "1.0",
                "net_cost_currency_unit": 1,
                "unit_price_currency": "USD",
                "quantity": 10.0,
                "duration": 0.419,
                "subscription_resource_name": "Licenses",
                "plan_resource_id": 76,
                "resource_id": 1,
                "order_id": 2291,
                "operate_to": "2022-12-31",
                "close_date": "2022-12-31",
                "billing_date": "2022-12-01",
                "application_template_key": "",
                "additional_params": [
                    {
                        "tenant_name": "XXXXX",
                        "tenant_id": 41,
                        "order_id": 2291,
                        "subscription_id": 950,
                        "offer_id": ""
                    }
                ],
                "discount": "0.00",
                "original_amount": "41.9",
                "original_amount_currency": "USD",
                "currency_rate": "1.0",
                "currency_unit": 1,
                "net_cost_original_currency": "USD",
                "tax_is_calculated_using": "gross_prices"
            },
            "relationships": {
                "taxes": {
                    "data": [
                        {
                            "id": "577",
                            "type": "taxes"
                        },
                        {
                            "id": "578",
                            "type": "taxes"
                        },
                        {
                            "id": "579",
                            "type": "taxes"
                        },
                        {
                            "id": "580",
                            "type": "taxes"
                        }
                    ]
                },
                "reseller": {
                    "data": {
                        "id": "3",
                        "type": "resellers"
                    }
                },
                "account": {
                    "data": {
                        "id": "41",
                        "type": "accounts"
                    }
                },
                "subscription": {
                    "data": {
                        "id": "950",
                        "type": "subscriptions"
                    }
                },
                "plan": {
                    "data": {
                        "id": "63",
                        "type": "plans"
                    }
                },
                "plan_resource": {
                    "data": {
                        "id": "76",
                        "type": "plan_resources"
                    }
                },
                "discount": {
                    "data": null
                }
            }
        },
        {
            "id": "4331",
            "type": "charges",
            "attributes": {
                "created_at": "2022-12-19T08:31:52.152571+0000",
                "updated_at": "2023-02-20T01:02:21.288026+0000",
                "subscription_id": 951,
                "subscription_resource_id": 1008,
                "operate_from": "2022-12-19",
                "description": "Upgrade resource (recurring fee) \"Licenses\" for Subscription #951 \"Office\"",
                "unit_price": "10.0",
                "amount": "17.22",
                "status": "closed",
                "type": "Charge::Recurring",
                "net_cost": "12.07",
                "net_amount": "8.38",
                "taxes_amount": "8.84",
                "net_cost_original": "12.07",
                "net_cost_currency_rate": "1.0",
                "net_cost_currency_unit": 1,
                "unit_price_currency": "USD",
                "quantity": 2.0,
                "duration": 0.419,
                "subscription_resource_name": "Licenses",
                "plan_resource_id": 77,
                "resource_id": 1,
                "order_id": 2292,
                "operate_to": "2022-12-31",
                "close_date": "2022-12-31",
                "billing_date": "2022-12-01",
                "application_template_key": "",
                "additional_params": [
                    {
                        "tenant_name": "XXXXX",
                        "tenant_id": 38,
                        "order_id": 2292,
                        "subscription_id": 951,
                        "offer_id": ""
                    }
                ],
                "discount": "0.00",
                "original_amount": "17.22",
                "original_amount_currency": "USD",
                "currency_rate": "1.0",
                "currency_unit": 1,
                "net_cost_original_currency": "USD",
                "tax_is_calculated_using": "net_prices"
            },
            "relationships": {
                "taxes": {
                    "data": [
                        {
                            "id": "581",
                            "type": "taxes"
                        },
                        {
                            "id": "582",
                            "type": "taxes"
                        },
                        {
                            "id": "583",
                            "type": "taxes"
                        },
                        {
                            "id": "584",
                            "type": "taxes"
                        },
                        {
                            "id": "5976",
                            "type": "taxes"
                        },
                        {
                            "id": "5977",
                            "type": "taxes"
                        },
                        {
                            "id": "5978",
                            "type": "taxes"
                        },
                        {
                            "id": "5979",
                            "type": "taxes"
                        },
                        {
                            "id": "5980",
                            "type": "taxes"
                        },
                        {
                            "id": "5981",
                            "type": "taxes"
                        }
                    ]
                },
                "reseller": {
                    "data": {
                        "id": "4",
                        "type": "resellers"
                    }
                },
                "account": {
                    "data": {
                        "id": "38",
                        "type": "accounts"
                    }
                },
                "subscription": {
                    "data": {
                        "id": "951",
                        "type": "subscriptions"
                    }
                },
                "plan": {
                    "data": {
                        "id": "64",
                        "type": "plans"
                    }
                },
                "plan_resource": {
                    "data": {
                        "id": "77",
                        "type": "plan_resources"
                    }
                },
                "discount": {
                    "data": null
                }
            }
        }
    ],
    "links": {
        "self": "https://test.activeplatform.com/api/v3/resellers/1/child_reseller_charges?page%5Bnumber%5D=2&page%5Bsize%5D=2",
        "first": "https://test.activeplatform.com/api/v3/resellers/1/child_reseller_charges?page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "prev": "https://test.activeplatform.com/api/v3/resellers/1/child_reseller_charges?page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "next": "https://test.activeplatform.com/api/v3/resellers/1/child_reseller_charges?page%5Bnumber%5D=3&page%5Bsize%5D=2",
        "last": "https://test.activeplatform.com/api/v3/resellers/1/child_reseller_charges?page%5Bnumber%5D=78&page%5Bsize%5D=2"
    },
    "meta": {
        "currency": "EUR"
    }
}