Get a List of Charges

See also API v3 methods that can be called for the current Reseller or for any of its downstream Resellers by the specified Reseller ID (see Reseller Charges).

The Get List of Charges API v1 method returns the list of Charges for current Reseller.

(warning) The {base_url}/api/vendor/v1/charges method is deprecated. Use the following instead:

GET {base_url}/api/reseller/v1/charges.json?api_token={api_token}

Arguments

Name

Parameter Type

Data type

Required/Optional

Description

api_tokenquerystringRequiredAPI token of the Manager that performs the operation (see Viewing and updating manager's information). This token is used for determination of the current Reseller and authentication in the API service

page

query

integer

Optional

Set the page number

per_pagequeryintegerOptionalSetting a number of items in the page
sorting[field]querystringOptionalSorting the list by the specified field
sorting[reversed]queryboolOptional

Set the reversed sorting mode by the specified field:

  • true — descending sorting.
  • false — ascending sorting (by default).
filters[created_at]querystringOptionalFiltering the list by a creation date
filters[updated_at]querystringOptionalFiltering the list by an update date
filters[subscription_id]queryintegerOptionalFiltering the list by Subscription ID
filters[status]querystringOptionalFiltering the list by a status

Response model

Name

Data type

Description

id

integerCharge ID

subscription_id

integerSubscription ID

subscription_resource_id

integerResource ID in the Subscription

subscription_resource_name

stringResource name in the Subscription

plan_resource_id

integerResource ID in the Plan of the selected Reseller

resource_id

integerResource ID in the Application Template

quantity

integerAmount of ordered Resource or Service units

operate_from

dateStart date of the period for which the Charge has been paid

operate_to

dateEnd date of the period for which the Charge has been paid

duration

floatCharge period duration in months. For example, 1 day equals to 0.033, 2 years equal to 24

description

stringCharge description

unit_price

floatService or Resource unit price for the selected Reseller

amount

floatCharge total amount

status

stringCharge status (see Charges attributes for the list of statuses)

type

stringCharge internal type:
  • Charge::Setup — Charge for the Subscription setup fee.
  • Charge::Recurring — Charge for the Subscription recurring fee.
  • Charge::RecurringResource — Charge for the Subscription Resource recurring fee.
  • Charge::Renewal — Charge for the Subscription renewal fee.
  • Charge::RenewalResource — Charge for the Resource renewal.
  • Charge::ExternalResource — Charge for the external Resource usage.
  • Charge::SetupResource — Charge for the Subscription Resource setup fee.
  • Charge::Transfer — Charge for the domain transfer.

order_id

integerID of the corresponding Order

close_date

dateDate when Charge will be closed
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 

created_at

dateCharge creation date

updated_at

dateCharge update date

Request example

GET https://test.activeplatform.com/api/reseller/v1/charges.json?api_token=Y5fwetest3gJXZH5uHCw&page=10&per_page=2&sorting[field]=amount&sorting[reversed]=true

Response example

[
    {
        "id": 75632,
        "subscription_id": 3005821,
        "subscription_resource_id": 31417,
        "subscription_resource_name": "Ресурс4",
        "plan_resource_id": 5833,
        "resource_id": 272,
        "quantity": 1,
        "operate_from": "2020-11-01",
        "operate_to": "2020-11-14",
        "duration": 0.467,
        "description": "Upgrade resource (recurring fee) \"Ресурс4\" for Subscription #3005821 \"Clean Reservation\"",
        "unit_price": "10000000.0",
        "amount": "2335000.0",
        "status": "new",
        "type": "Charge::Recurring",
        "order_id": 8224,
        "close_date": "2020-11-14",
        "original_amount": "2335000.0",
        "original_amount_currency": "BYN",
        "currency_rate": "1.0",
        "currency_unit": 1,
        "created_at": "2019-11-15T12:22:01.318042+0300",
        "updated_at": "2019-11-15T12:22:01.318042+0300"
    },
    {
        "id": 17296,
        "subscription_id": 3002088,
        "subscription_resource_id": 10990,
        "subscription_resource_name": "Max Storage Size (GB)",
        "plan_resource_id": 2051,
        "resource_id": 1016,
        "quantity": 10011,
        "operate_from": "2017-09-01",
        "operate_to": "2017-09-22",
        "duration": 0.733,
        "description": "Upgrade resource (recurring fee) \"Max Storage Size (GB)\" for Subscription #3002088 \"OnlyOffice\"",
        "unit_price": "100.0",
        "amount": "733806.3",
        "status": "closed",
        "type": "Charge::Recurring",
        "order_id": 1773,
        "close_date": "2017-09-22",
        "original_amount": "733806.3",
        "original_amount_currency": "BYN",
        "currency_rate": "1.0",
        "currency_unit": 1,
        "created_at": "2017-08-24T16:17:29.707136+0300",
        "updated_at": "2017-10-19T01:03:44.803022+0300"
    }
]