Get list of reseller charges

The Get list of reseller charges method returns the list of reseller charges 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}/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

Taxestaxes
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 the 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 (taxes 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.


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 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.


unit_price_currencystringThe plan currency code for the unit price


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:

  • 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


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


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


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
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 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

  • 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

Request example

GET /api/v3/resellers/14/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": "62",
            "type": "reseller_charges",
            "attributes": {
                "created_at": "2023-01-10T12:32:04.652975+0000",
                "updated_at": "2023-01-10T12:32:04.652975+0000",
                "charge_id": 5360,
                "subscription_id": 1251,
                "unit_price": "12.0",
                "amount": "1891.44",
                "net_cost": "1065.0",
                "tax_is_calculated_using": "net_prices",
                "net_cost_original": "710.0",
                "net_cost_currency_rate": "1.5",
                "net_cost_currency_unit": 1,
                "net_amount": "1278.0",
                "subscription_resource_id": 1369,
                "subscription_resource_name": "Licenses",
                "plan_resource_id": 104,
                "resource_id": 1,
                "unit_price_currency": "USD",
                "quantity": 100.0,
                "operate_from": "2023-01-10",
                "operate_to": "2023-01-31",
                "duration": 0.71,
                "description": "Upgrade resource (recurring fee) \"Licenses\" for Subscription #1251 \"Office\"",
                "type": "Charge::Recurring",
                "order_id": 2838,
                "application_template_key": "",
                "additional_params": [
                    {
                        "tenant_name": "XXXXX",
                        "tenant_id": 103,
                        "order_id": 2838,
                        "subscription_id": 1251,
                        "offer_id": ""
                    }
                ],
                "discount": "0.00",
                "original_amount": "1260.96",
                "original_amount_currency": "USD",
                "taxes_amount": "613.44",
                "currency_rate": "1.5",
                "currency_unit": 1,
                "billing_date": "2023-01-01",
                "net_cost_original_currency": "USD"
            },
            "relationships": {
                "reseller": {
                    "data": {
                        "id": "14",
                        "type": "resellers"
                    }
                },
                "account": {
                    "data": {
                        "id": "103",
                        "type": "accounts"
                    }
                },
                "subscription": {
                    "data": {
                        "id": "1251",
                        "type": "subscriptions"
                    }
                },
                "plan": {
                    "data": {
                        "id": "18",
                        "type": "plans"
                    }
                },
                "plan_resource": {
                    "data": {
                        "id": "104",
                        "type": "plan_resources"
                    }
                },
                "manager": {
                    "data": {
                        "id": "5",
                        "type": "managers"
                    }
                },
                "discount": {
                    "data": null
                },
                "taxes": {
                    "data": [
                        {
                            "id": "73",
                            "type": "taxes"
                        },
                        {
                            "id": "74",
                            "type": "taxes"
                        },
                        {
                            "id": "75",
                            "type": "taxes"
                        }
                    ]
                }
            }
        },
        {
            "id": "63",
            "type": "reseller_charges",
            "attributes": {
                "created_at": "2023-01-12T16:17:08.706276+0000",
                "updated_at": "2023-01-12T16:17:08.706276+0000",
                "charge_id": 5373,
                "subscription_id": 1257,
                "unit_price": "12.0",
                "amount": "114.55",
                "net_cost": "64.5",
                "tax_is_calculated_using": "net_prices",
                "net_cost_original": "64.5",
                "net_cost_currency_rate": "1.0",
                "net_cost_currency_unit": 1,
                "net_amount": "77.4",
                "subscription_resource_id": 1375,
                "subscription_resource_name": "Licenses",
                "plan_resource_id": 104,
                "resource_id": 1,
                "unit_price_currency": "USD",
                "quantity": 10.0,
                "operate_from": "2023-01-12",
                "operate_to": "2023-01-31",
                "duration": 0.645,
                "description": "Upgrade resource (recurring fee) \"Licenses\" for Subscription #1257 \"Office\"",
                "type": "Charge::Recurring",
                "order_id": 2846,
                "application_template_key": "",
                "additional_params": [
                    {
                        "tenant_name": "XXXXX",
                        "tenant_id": 103,
                        "order_id": 2846,
                        "subscription_id": 1257,
                        "offer_id": ""
                    }
                ],
                "discount": "0.00",
                "original_amount": "114.55",
                "original_amount_currency": "USD",
                "taxes_amount": "37.15",
                "currency_rate": "1.0",
                "currency_unit": 1,
                "billing_date": "2023-01-01",
                "net_cost_original_currency": "USD"
            },
            "relationships": {
                "reseller": {
                    "data": {
                        "id": "14",
                        "type": "resellers"
                    }
                },
                "account": {
                    "data": {
                        "id": "103",
                        "type": "accounts"
                    }
                },
                "subscription": {
                    "data": {
                        "id": "1257",
                        "type": "subscriptions"
                    }
                },
                "plan": {
                    "data": {
                        "id": "18",
                        "type": "plans"
                    }
                },
                "plan_resource": {
                    "data": {
                        "id": "104",
                        "type": "plan_resources"
                    }
                },
                "manager": {
                    "data": {
                        "id": "5",
                        "type": "managers"
                    }
                },
                "discount": {
                    "data": null
                },
                "taxes": {
                    "data": [
                        {
                            "id": "76",
                            "type": "taxes"
                        },
                        {
                            "id": "77",
                            "type": "taxes"
                        },
                        {
                            "id": "78",
                            "type": "taxes"
                        },
                        {
                            "id": "79",
                            "type": "taxes"
                        }
                    ]
                }
            }
        }
    ],
    "links": {
        "self": "https://test.activeplatform.com/api/v3/resellers/14/reseller_charges?page%5Bnumber%5D=2&page%5Bsize%5D=2",
        "first": "https://test.activeplatform.com/api/v3/resellers/14/reseller_charges?page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "prev": "https://test.activeplatform.com/api/v3/resellers/14/reseller_charges?page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "next": "https://test.activeplatform.com/api/v3/resellers/14/reseller_charges?page%5Bnumber%5D=3&page%5Bsize%5D=2",
        "last": "https://test.activeplatform.com/api/v3/resellers/14/reseller_charges?page%5Bnumber%5D=5&page%5Bsize%5D=2"
    }
}