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

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

Response model

Name

Data type

Description

dataarrayResponse data


id

integerID of the charge

typestringData type

attributesobjectInformation about the charge


created_atdateDate and time of the charge creation


updated_atdateDate 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_pricefloatThe unit price of the service or resource in the plan currency


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


net_costfloat

The net cost of the charge in the plan currency for the selected reseller, for delegated plans only:

net_cost = license_fee × duration × quantity

where license_fee is the license fee for a resource or period of the plan specified in the license (not stored in the reseller charge, see Creating a License)



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


quantityintegerThe number of ordered services or resources


operate_from

dateThe start date of the period paid by the charge


operate_todateThe finish date of the period paid by the charge


durationfloatPeriod 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 Application Template details)


additional_paramsarray of objects

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

  • 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

In other cases, returns the empty array




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


original_amountstring

Charge total amount in the plan currency



original_amount_currencystringCurrency code of the plan


currency_ratestringExchange rate used for generating the charge 


currency_unitintegerCurrency units used for generating the charge 


billing_datedateStart date of the related billing period

relationshipsobjectRelated objects


resellerobjectReseller information



dataobject

Related object information:

NameData typeDescription
idintegerID of the object
typestringData type


accountobjectAccount information



dataobject

Related object information:

NameData typeDescription
idintegerID of the object
typestringData type


subscriptionobjectSubscription information



dataobject

Related object information:

NameData typeDescription
idintegerID of the object
typestringData type


planobjectPlan information



dataobject

Related object information:

NameData typeDescription
idintegerID of the object
typestringData type


managerobjectManager information



dataobject

Related object information:

NameData typeDescription
idintegerID of the object
typestringData type


plan_resourceobjectPlan resource information



dataobject

Related object information:

NameData typeDescription
idintegerID of the object
typestringData type


discountobjectDiscount information



dataobject

Related object information:

NameData typeDescription
idintegerID of the object
typestringData type
includedarray

Additional information about objects listed in the request:

NameData typeDescription
idintegerID 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_atdateDate and time of the subscription creation

updated_atdateDate 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_fromdateThe start date of generating charges for the subscription 

expiration_datedateThe expiration date of the subscription 

namestringName of the subscription 

auto_renew_point_daysinteger

Auto-renew point (in days)


start_datedateThe date of activation of the subscription 

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_limitfloatThe value of the subscription debt, above which the postpaid subscription will be stopped. For postpaid subscriptions only (payment_model = postpay)


current_debtfloatThe 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 (in the YYYY-MM-DD format)

duration_tostringEnd date of the discount period (in the YYYY-MM-DD format)
  • 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_feefloat

Setup fee of the resource


recurring_feefloat

Monthly recurring fee of the resource


overuse_feefloat

Overuse fee of the resource


renewal_feefloat

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
  • For delegated plans — the resource costs on the level of the upstream reseller (net costs).
  • For other plans — the method returns all the costs equal to 0.


setup_feefloat

Setup fee of the resource



recurring_feefloat

Monthly recurring fee of the resource



overuse_feefloat

Overuse fee of the resource



renewal_feefloat

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/230/reseller_charges?include=reseller,account,subscription,plan,discount&date_from=2018-07-01&date_to=2019-06-30&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": "1277",
            "type": "reseller_charges",
            "attributes": {
                "created_at": "2018-07-06T11:32:53.280+03:00",
                "updated_at": "2018-07-06T11:32:53.280+03:00",
                "charge_id": 42154,
                "subscription_id": 3003909,
                "unit_price": "7.0",
                "amount": "84.0",
                "net_cost": 84,
                "subscription_resource_id": 24839,
                "subscription_resource_name": "r1",
                "plan_resource_id": 2949,
                "resource_id": 1424,
                "quantity": 1,
                "operate_from": "2018-07-06",
                "operate_to": "2019-07-05",
                "duration": 12,
                "description": "Switch resource (recurring fee) \"r1\" from subscription #3003909 \"CSP Monthly v1 switch\" to \"CSP Monthly v1 switch\"",
                "type": "Charge::Recurring",
                "order_id": 4807,
				"application_template_key": "",
                "additional_params": [],
                "discount": "0.00",
                "original_amount": "84.0",
                "original_amount_currency": "USD",
                "currency_rate": "1.0",
                "currency_unit": 1,
				"billing_date": "2018-07-01"
            },
            "relationships": {
                "reseller": {
                    "data": {
                        "id": "230",
                        "type": "resellers"
                    }
                },
                "account": {
                    "data": {
                        "id": "278",
                        "type": "accounts"
                    }
                },
                "subscription": {
                    "data": {
                        "id": "3003909",
                        "type": "subscriptions"
                    }
                },
                "plan": {
                    "data": {
                        "id": "850",
                        "type": "plans"
                    }
                },
                "manager": {
                    "data": {
                        "id": "186",
                        "type": "managers"
                    }
                },
                "plan_resource": {
                    "data": {
                        "id": "2949",
                        "type": "plan_resources"
                    }
                },
                "discount": {
                    "data": null
                }
            }
        },
        {
            "id": "1310",
            "type": "reseller_charges",
            "attributes": {
                "created_at": "2018-05-25T14:50:24.472+03:00",
                "updated_at": "2018-05-25T14:50:24.472+03:00",
                "charge_id": 43784,
                "subscription_id": 3003965,
                "unit_price": "5.0",
                "amount": "60.0",
                "net_cost": 60,
                "subscription_resource_id": 24996,
                "subscription_resource_name": "Resource 1",
                "plan_resource_id": 2940,
                "resource_id": 8,
                "quantity": 1,
                "operate_from": "2018-05-25",
                "operate_to": "2019-05-24",
                "duration": 12,
                "description": "Upgrade resource (recurring fee) \"Resource 1\" for subscription #3003965 \"CSP plan with resources\"",
                "type": "Charge::Recurring",
                "order_id": 4919,
				"application_template_key": "",
                "additional_params": [],
                "discount": "0.00",
                "original_amount": "60.0",
                "original_amount_currency": "USD",
                "currency_rate": "1.0",
                "currency_unit": 1,
				"billing_date": "2018-05-01"
            },
            "relationships": {
                "reseller": {
                    "data": {
                        "id": "230",
                        "type": "resellers"
                    }
                },
                "account": {
                    "data": {
                        "id": "278",
                        "type": "accounts"
                    }
                },
                "subscription": {
                    "data": {
                        "id": "3003965",
                        "type": "subscriptions"
                    }
                },
                "plan": {
                    "data": {
                        "id": "847",
                        "type": "plans"
                    }
                },
                "manager": {
                    "data": {
                        "id": "186",
                        "type": "managers"
                    }
                },
                "plan_resource": {
                    "data": {
                        "id": "2940",
                        "type": "plan_resources"
                    }
                },
                "discount": {
                    "data": null
                }
            }
        }
    ],
    "included": [
        {
            "id": "230",
            "type": "resellers",
            "attributes": {...
            }
        },
        {
            "id": "278",
            "type": "accounts",
            "attributes": {...
            },
            "relationships": {...
            }
        },
        {
            "id": "3003909",
            "type": "subscriptions",
            "attributes": {
                "created_at": "2018-07-06T11:31:35.930767+0300",
                "updated_at": "2019-08-08T07:15:28.107062+0300",
                "auto_renewal": false,
                "billing_from": "2018-07-06",
                "expiration_date": "2019-07-06",
                "name": "CSP Monthly v1 switch",
                "auto_renew_point_days": 365,
                "start_date": "2018-07-06",
                "status": "deleted",
                "payment_model": "prepay",
                "payment_model_parameters": {}
            }
        },
        {
            "id": "850",
            "type": "plans",
            "attributes": {...
            }
        },
        {
            "id": "3003965",
            "type": "subscriptions",
            "attributes": {
                "created_at": "2018-05-25T14:49:57.934152+0300",
                "updated_at": "2019-06-09T07:15:24.603637+0300",
                "auto_renewal": false,
                "billing_from": "2018-05-25",
                "expiration_date": "2019-05-25",
                "name": "CSP plan with resources",
                "auto_renew_point_days": 0,
                "start_date": "2018-05-25",
                "status": "deleted",
                "payment_model": "prepay",
                "payment_model_parameters": {}
            }
        },
        {
            "id": "847",
            "type": "plans",
            "attributes": {...
            }
        }
    ],
    "links": {
        "self": "https://test.activeplatform.com/api/v3/resellers/230/reseller_charges?date_from=2018-07-01&date_to=2019-06-30&include=reseller%2Caccount%2Csubscription%2Cplan%2Cdiscount&page%5Bnumber%5D=2&page%5Bsize%5D=2",
        "first": "https://test.activeplatform.com/api/v3/resellers/230/reseller_charges?date_from=2018-07-01&date_to=2019-06-30&include=reseller%2Caccount%2Csubscription%2Cplan%2Cdiscount&page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "prev": "https://test.activeplatform.com/api/v3/resellers/230/reseller_charges?date_from=2018-07-01&date_to=2019-06-30&include=reseller%2Caccount%2Csubscription%2Cplan%2Cdiscount&page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "next": "https://test.activeplatform.com/api/v3/resellers/230/reseller_charges?date_from=2018-07-01&date_to=2019-06-30&include=reseller%2Caccount%2Csubscription%2Cplan%2Cdiscount&page%5Bnumber%5D=3&page%5Bsize%5D=2",
        "last": "https://test.activeplatform.com/api/v3/resellers/230/reseller_charges?date_from=2018-07-01&date_to=2019-06-30&include=reseller%2Caccount%2Csubscription%2Cplan%2Cdiscount&page%5Bnumber%5D=3&page%5Bsize%5D=2"
    }
}

Отзыв | Feedback