Get a List of the Reseller end-customers Charges
The Get a List of the Reseller end-customers Charges method returns the list of end-customers Charges of the current Reseller or any of its downstream Resellers.
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}/charges
Arguments
Name | Parameter Type | Data type | Required/ | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
X-Api-Token | header | string | Required | API token of a Manager that performs the operation (see Viewing and updating manager's information) | ||||||||||
Content-Type | header | string | Required | Media type of the request. Specify the following: application/vnd.api+json | ||||||||||
Accept | header | string | Required | Supported media types of the answer. Specify the following: application/vnd.api+json | ||||||||||
base_url | path | string | Required | ActivePlatform URL | ||||||||||
reseller_id | path | integer | Required | ID of the current Reseller or any of its downstream Resellers (see Viewing and updating reseller general information) | ||||||||||
page[size] | query | integer | Optional | Page navigation: number of elements per page. The default value is 50 | ||||||||||
page[number] | query | integer | Optional | Page navigation: page number | ||||||||||
filter[close_date] | query | date | Optional | Filtering Charges by the close date in the YYYY-MM-DD format. To specify the period, the following filters are used:
| ||||||||||
filter[subscription_id] | query | integer | Optional | Filtering Charges by the Subscription ID | ||||||||||
filter[status] | query | string | Optional | Filtering 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 RFC 3339 format (for example, 2017-10-04T15:12:01.558009+03:00). To specify the period, the following filters are used:
| ||||||||||
filter[updated_at] | query | string | Optional | Filtering Charges by the date and time when the Charge was updated in the RFC 3339 format (for example, 2017-10-04T15:12:01.558009+03:00). To specify the period, the following filters are used:
| ||||||||||
filter[plan_class_ids] | query | string | Optional | Filtering Charges by Plan Class ID (see Viewing the list of service terms). Several IDs must be separated by a comma | ||||||||||
include | query | string | Optional | 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:
|
Response model
Name | Data type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | array | Response data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id | integer | ID of the Charge | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type | string | Data type | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
attributes | object | Information about the Charge | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
created_at | date | Date and time of the Charge creation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
updated_at | date | Date and time when the Charge was updated | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
subscription_id | integer | ID of the customer's Subscription | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
subscription_resource_id | integer | ID of the Resource in the customer's Subscription | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
quantity | integer | The number of ordered Services or Resources | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
operate_from | date | The start date of the period paid by the Charge | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
duration | float | Period of the Charge (in months). For example, 1 day = 0.033, 2 years = 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description | string | Charge details description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
unit_price | float | The unit price of the Service or Resource in the Plan currency | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
amount | float | Total amount of the Charge (Discount included) in the Reseller currency | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
status | string | Status of the Charge (for the list of Charge statuses, see Charges attributes) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type | string | Type of the Charge (see also Charges attributes)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
net_cost | float | The net cost of the Charge in the Plan currency for the selected Reseller. For delegated Plans only. Calculated using the price of the upstream Reseller | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
taxes_amount | float | The amount of taxes for the Charge in the Reseller currency | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
subscription_resource_name | string | Name of the Resource in the customer's Subscription | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
plan_resource_id | integer | Name of the Resource in the customer's Plan | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
resource_id | integer | ID of the Resource | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
order_id | integer | ID of the Order | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
operate_to | date | The finish date of the period paid by the Charge | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
close_date | date | The close date of the Charge | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
billing_date | date | Start date of the related Billing period | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
application_template_key | string | Key of the Application template linked to the Subscription (see Viewing and updating connector details) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
additional_params | array of objects | Additional parameters of the Charge for Services based on the following plugins:
In other cases, returns the empty array | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
discount | float | The amount of the Discount for the Charge in the Reseller currency | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
original_amount | string | Charge total amount in the Plan currency | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
original_amount_currency | string | Currency code of the Plan | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
currency_rate | string | Exchange rate used for generating the Charge | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
currency_unit | integer | Currency units used for generating the Charge | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
relationships | object | Related objects | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
taxes | object | Taxes information | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | array | Related object information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
reseller | object | Reseller information | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | object | Related object information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
account | object | Account information | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | object | Related object information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
subscription | object | Subscription information | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | object | Related object information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
plan | object | Plan information | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | object | Related object information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
plan_resource | object | Plan Resource information | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | object | Related object information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
discount | object | Discount information | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | object | Related object information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
included | array | Additional information about objects listed in the request:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
links | array | Page navigation links that use the defined page navigation parameters | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
self | string | Current page link | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
first | string | First page link | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
prev | string | Previous page link | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
next | string | Next page link | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
last | string | Last page link | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
meta | array | Additional information about the Charge | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
currency | string | Reseller's currency code |
Request example
GET /api/v3/resellers/1/charges?page[size]=2&page[number]=70&filter[close_date][gte]=2019-10-01&filter[close_date][lte]=2019-10-31&filter[status]=closed&filter[plan_class_ids]=1,5&include=reseller,account,subscription,plan
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json
Response example
{
"data": [
{
"id": "73083",
"type": "charges",
"attributes": {
"created_at": "2019-08-21T11:50:21.263342+0300",
"updated_at": "2019-11-16T01:18:26.253966+0300",
"subscription_id": 3005638,
"subscription_resource_id": 30146,
"quantity": 1,
"operate_from": "2019-09-01",
"duration": 0.667,
"description": "Upgrade resource (recurring fee) \"res3\" for Subscription #3005638 \"Auto provisioning with resources\"",
"unit_price": "2.0",
"amount": "1.27",
"status": "closed",
"type": "Charge::Recurring",
"net_cost": null,
"taxes_amount": 0,
"subscription_resource_name": "res3",
"plan_resource_id": 2158,
"resource_id": 10,
"order_id": 8025,
"operate_to": "2019-09-20",
"close_date": "2019-09-30",
"billing_date": "2019-09-01",
"application_template_key": "",
"additional_params": [],
"discount": "0.06",
"original_amount": "1.27",
"original_amount_currency": "BYN",
"currency_rate": "1.0",
"currency_unit": 1
},
"relationships": {
"taxes": {
"data": []
},
"reseller": {
"data": {
"id": "1",
"type": "resellers"
}
},
"account": {
"data": {
"id": "494",
"type": "accounts"
}
},
"subscription": {
"data": {
"id": "3005638",
"type": "subscriptions"
}
},
"plan": {
"data": {
"id": "5",
"type": "plans"
}
},
"plan_resource": {
"data": null
},
"discount": {
"data": {
"id": "89",
"type": "discounts"
}
}
}
},
{
"id": "73109",
"type": "charges",
"attributes": {
"created_at": "2019-08-22T15:59:54.376771+0300",
"updated_at": "2019-10-12T01:15:30.459665+0300",
"subscription_id": 3005649,
"subscription_resource_id": null,
"quantity": 1,
"operate_from": "2019-09-01",
"duration": 1,
"description": "Switch resource (recurring fee) #3005649 \"Auto provisioning with resources\"",
"unit_price": "1.0",
"amount": "1.0",
"status": "closed",
"type": "Charge::Recurring",
"net_cost": null,
"taxes_amount": 0,
"subscription_resource_name": null,
"plan_resource_id": null,
"resource_id": null,
"order_id": 8036,
"operate_to": "2019-09-30",
"close_date": "2019-09-30",
"billing_date": "2019-09-01",
"application_template_key": "",
"additional_params": [],
"discount": "0.00",
"original_amount": "1.0",
"original_amount_currency": "BYN",
"currency_rate": "1.0",
"currency_unit": 1
},
"relationships": {
"taxes": {
"data": []
},
"reseller": {
"data": {
"id": "1",
"type": "resellers"
}
},
"account": {
"data": {
"id": "503",
"type": "accounts"
}
},
"subscription": {
"data": {
"id": "3005649",
"type": "subscriptions"
}
},
"plan": {
"data": {
"id": "5",
"type": "plans"
}
},
"plan_resource": {
"data": null
},
"discount": {
"data": null
}
}
}
],
"included": [
{
"id": "1",
"type": "resellers",
"attributes": {...
}
},
{
"id": "494",
"type": "accounts",
"attributes": {...
},
"relationships": {...
}
},
{
"id": "3005638",
"type": "subscriptions",
"attributes": {
"created_at": "2019-08-21T11:50:21.083490+0300",
"updated_at": "2019-11-16T01:18:26.153891+0300",
"auto_renewal": false,
"billing_from": "2019-08-21",
"expiration_date": "2019-09-21",
"name": "Auto provisioning with resources",
"auto_renew_point_days": 1,
"start_date": "2019-08-21",
"status": "deleted",
"payment_model": "postpay",
"payment_model_parameters": {
"credit_limit": 100,
"current_debt": 0
}
}
},
{
"id": "5",
"type": "plans",
"attributes": {...
}
},
{
"id": "503",
"type": "accounts",
"attributes": {...
},
"relationships": {...
}
},
{
"id": "3005649",
"type": "subscriptions",
"attributes": {
"created_at": "2019-08-22T15:59:54.138703+0300",
"updated_at": "2019-09-20T10:47:07.896382+0300",
"auto_renewal": false,
"billing_from": "2019-08-22",
"expiration_date": "2019-12-22",
"name": "Auto provisioning with resources",
"auto_renew_point_days": 1,
"start_date": "2019-08-22",
"status": "waiting_for_manual_approve",
"payment_model": "postpay",
"payment_model_parameters": {
"credit_limit": 0,
"current_debt": 0
}
}
}
],
"links": {
"self": "https://test.activeplatform.com/api/v3/resellers/1/charges?filter%5Bclose_date%5D%5Bgte%5D=2019-10-01&filter%5Bclose_date%5D%5Blte%5D=2019-10-31&filter%5Bplan_class_ids%5D=1%2C5&filter%5Bstatus%5D=closed&include=reseller%2Caccount%2Csubscription%2Cplan&page%5Bnumber%5D=70&page%5Bsize%5D=2",
"first": "https://test.activeplatform.com/api/v3/resellers/1/charges?filter%5Bclose_date%5D%5Bgte%5D=2019-10-01&filter%5Bclose_date%5D%5Blte%5D=2019-10-31&filter%5Bplan_class_ids%5D=1%2C5&filter%5Bstatus%5D=closed&include=reseller%2Caccount%2Csubscription%2Cplan&page%5Bnumber%5D=1&page%5Bsize%5D=2",
"prev": "https://test.activeplatform.com/api/v3/resellers/1/charges?filter%5Bclose_date%5D%5Bgte%5D=2019-10-01&filter%5Bclose_date%5D%5Blte%5D=2019-10-31&filter%5Bplan_class_ids%5D=1%2C5&filter%5Bstatus%5D=closed&include=reseller%2Caccount%2Csubscription%2Cplan&page%5Bnumber%5D=69&page%5Bsize%5D=2",
"next": "https://test.activeplatform.com/api/v3/resellers/1/charges?filter%5Bclose_date%5D%5Bgte%5D=2019-10-01&filter%5Bclose_date%5D%5Blte%5D=2019-10-31&filter%5Bplan_class_ids%5D=1%2C5&filter%5Bstatus%5D=closed&include=reseller%2Caccount%2Csubscription%2Cplan&page%5Bnumber%5D=71&page%5Bsize%5D=2",
"last": "https://test.activeplatform.com/api/v3/resellers/1/charges?filter%5Bclose_date%5D%5Bgte%5D=2019-10-01&filter%5Bclose_date%5D%5Blte%5D=2019-10-31&filter%5Bplan_class_ids%5D=1%2C5&filter%5Bstatus%5D=closed&include=reseller%2Caccount%2Csubscription%2Cplan&page%5Bnumber%5D=79&page%5Bsize%5D=2"
},
"meta": {
"currency": "BYN"
}
}