Get a List of the Reseller's Accounts

The Get a List of the Reseller's Accounts API method returns the list of Accounts of the current Reseller or any of its downstream Resellers.

Access to the current Reseller and downstream Resellers is determined by the Manager's token in the API request.

GET {base_url}/api/v3/resellers/{reseller_id}/accounts

Arguments

Name

Parameter Type

Data type

Required/Optional

Description

X-Api-TokenheaderstringRequiredAPI token of the Manager that performs the operation (see Viewing and updating manager's information)
Content-TypeheaderstringRequiredIndicates the media type (text/html or text/JSON) of the request that is sent to the server by the client (browser)
AcceptheaderstringRequired

Information about data types that the client (browser) supports

reseller_idpathnumberRequiredID of the current Reseller or any of its downstream Resellers (see Viewing and updating reseller general information)
page[size]querynumberOptionalPage navigation: number of elements per page. The default value is 50
page[number]querynumberOptionalPage navigation: page number
filter[email]querystringOptionalFiltering by the email of the contract person. The parameter can be a comma-separated list
filter[user_email]querystringOptionalFiltering by the email of a User of the Account. Requests the list of all attached Accounts for the specified User
filter[inn]querystringOptionalFiltering by the Tax Identification Number of the Account (in Russian, Идентификационный номер налогоплательщика, ИНН) specified in the inn Account Attribute (see Managing attributes)
includequerystringOptional

Returns additional information about objects related to Accounts. The following objects and possible values are supported:

ObjectParameter value
Subscriptionsubscriptions

Response model

Name

Data type

Description

dataarray of objectsResponse data


id

string

Account ID

typestringData type

attributesobjectAccount information


created_at

string

Date and time of Account creation


updated_at

string

Data and time of Account last update


reseller_idnumberID of the Account's Reseller


namestringAccount name


account_class_idnumberAccount Class ID


primary_namestringPrimary name of the Account. For example, a company name


first_name

string

The first name of the contract person


middle_name

string

The middle name of the contract person


last_name

string

The last name of the contract person


countrystring

Contact information: a two-letter ISO code ISO 3166-1 alpha-2 of the country



regionstringContact information: Region


citystringContact information: City


streetstringContact information: Street


buildingstringContact information: Building


officestringContact information: Office


zipstringContact information: Zip-code


phonestring

Contact information: Phone number:

  • + < country code > < city code or network code > < phone number >
  • 00 < country code > < city code or network code > < phone number >


email

string

Email of the contract person


status

string

Account status (see Viewing and updating account's details for the list of statuses)



balancestringAccount balance regardless of the blocked Charges


usable_balancestringAvailable funds on the Account balance


current_debt

numberCurrent debt of the Account for all postpaid Subscriptions


subscription_credit_limit

numberThe value of the Subscription credit limit for the Account that is set in the Account class or redefined on the Account level


financial_blocking_threshold

numberThe value of the Financial blocking threshold for the Account that is set in the Account class or redefined on the Account level


account_type_idnumberAccount Type ID (см. Viewing the list of account types)


manager_idnumberAccount's Manager ID


owner_idnumberAccount's Owner ID


tech_user_idnumber

ID of the Account's User selected as Tech contact (see Viewing and updating account's details)



bill_user_idnumberID of the Account's User selected as Billing contact (see Viewing and updating account's details)


custom_attributes

object

Account Attributes (see Managing attributes)




attributes.custom-attributes['custom-attribute-key']string

Account Attribute value

For example, the Tax Identification Number of the Account (in Russian, Идентификационный номер налогоплательщика, ИНН) is specified in the inn Account Attribute



managerobject

Information about the Account's Manager




created_atstring
Date and time of the Manager creation



updated_atstring
Data and time of the Manager last update



reseller_idnumber
ID of the Manager's Reseller



idnumberID of the Manager



namestringName of the Manager



statusstring

Status of the Manager:

  • active — access to the Operator Control Panel is allowed
  • inactive — access to the Operator Control Panel is blocked



emailstringManager's email which is used as a login to the Operator Control Panel



rolestringManager's role (for the list of roles, see Managers' roles)



custom_attributesarrayThe list of the Manager's additional attributes (see Viewing the List of Attributes)




manager.custom-attributes['custom-attribute-key']stringThe value of the Attribute


ownerobjectinformation about the Owner of the Account



created_at

stringDate and time of Account's Owner creation



updated_at

stringDate and time of Account's Owner last update



emailstringEmail of the Account's Owner



account_statusstringAccount's Owner status for the Account (for information about statues, see Managing account's users)



global_statusstringAccount's Owner status in ActivePlatform



first_namestringThe first name of the Account's Owner



middle_namestringThe middle name of the Account's Owner



last_namestringThe last name of the Account's Owner


default_payment_model

string

Default payment model:

  • postpay
  • prepay


account_typeobjectInformation about the Account Type (see Viewing the list of account types)



idnumber
ID of the Account Type



namestringName of the Account Type



created_atstring
Date and time of the Account Type creation



updated_atstring
Date and time when the Account Type was updated



reseller_idnumber
ID of the Reseller linked to the Account type



name_patternstringTemplate of the Account type name which is displayed in the platform



primary_namestringName of the field with the primary name of the Account. For example, for the Business Account Type, the filed may be named as Company name



keystringKey that is used to refer to the Account Type by API or a Placeholder



default_payment_method_idnumber
ID of the default Payment method (see Configuring payment methods)



ancestrystring
ID of the parent Account Type



used_by_defaultbool

Default Account Type for new Accounts:

  • false — the Account Type is not applied to new Accounts
  • true — the Account Type is applied to new Accounts


account_classstringInformation about the Account Class (see Viewing the list of account classes)



idnumber
ID of the Account Class



reseller_idnumber
ID of the linked Reseller



namestringName of the Account Class



created_atstringDate and time of the Account Type creation



updated_atstringDate and time when the Account Type was updated



financial_blocking_threshold

stringThe value of the Financial blocking threshold that is set in the Account class



due_order_periodnumber
Number of days to pay for an Order before the Order becomes canceled (for the prepay payment model)



subzero_periodnumber
Number of days during which the Account balance can be negative without moving the Account to the Credit hold status. The "-1" value refers to the unlimited period



stop_subscription_typestringType of the Subscription stopping if the Account is moved to the Credit Hold (for the list of the available types of the Subscription stopping, see Creating an account class)



keystring Key that is used to refer to the Account Class by API or Placeholders



colorstringColor that is used in the List of Accounts (see Viewing the list of accounts) for this Account Type



guaranteed_payment_limitnumber
Maximum amount of the Guaranteed Payment that all Accounts, which are added to the Account Class, can use



guaranteed_payment_periodnumber
Number of days, during which all Accounts, which are added to the Account Class, can use the Guaranteed Payments



delete_subscription_typestringType of the Subscription deleting (for the list of the available types of the Subscription deleting, see Creating an account class)



denominatedbool

Attribute of the Account Type denomination:

  • false — the Account Type is not denominated
  • truethe Account Type is denominated



buy_with_negative_balancebool

Availability of paying for Orders with the negative Account Balance (for the prepay payment model):

  • falsepaying for Orders with the negative Account Balance is not available
  • truepaying for Orders with the negative Account Balance is available



receipt_daynumber
Deprecated



payment_modelstring

Payment model:

  • postpay
  • prepay



defaultbool

Default Account Class for new Accounts:

  • false — the Account Type is not applied to new Accounts
  • truethe Account Type is applied to new Accounts



due_payment_periodnumber
Number of days to pay for a Payment before the Payment becomes expired (for the postpay payment model)



subscription_credit_limit

stringThe value of the Subscription credit limit that is set in the Account class

relationshipsobject
Information about the related objects


subscriptionsobject
Information about the related Subscriptions



dataarrayInformation about the Subscription




idstringID of the Subscription




typestringData type
includedarray

Additional information about objects listed in the request:

NameData typeDescription
idintegerID of the object
typestringData type
attributesarrayAttributes of the object (see details below)

For a Subscription:

NameData typeDescription

created_at

stringDate and time of Subscription creation

updated_at

stringDate and time of Subscription last update

auto_renewal

bool

Subscription auto renewal attribute:

  • false — 
  • true — Auto renewal is set

billing_from

stringBeginning date of the Subscription paid period

expiration_date

stringSubscription expiration date

name

stringSubscription name

renew_point_days

numberRenew point (days)

start_date

stringSubscription activation date

status

stringSubscription status (see Viewing the list of Subscriptions for the list of Subscription statuses)

payment_model

string

Subscription payment model:

  • prepay
  • postpay

payment_model_parameters

objectPayment model parameters

credit_limitnumberThe value of the Subscription debt, above which the postpaid Subscription will be stopped. For postpaid Subscription 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 Subscription only (payment_model = postpay)
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/1/accounts?page[size]=2&page[number]=1&filter[email]=test@example.com&include=subscriptions
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json

Response example

{
    "data": [
        {
            "id": "487",
            "type": "accounts",
            "attributes": {
                "created_at": "2019-08-19T15:10:43.222+03:00",
                "updated_at": "2019-08-19T15:16:49.990+03:00",
                "reseller_id": 1,
                "name": "Vit August",
                "account_class_id": 1,
                "primary_name": "",
                "first_name": "Vit ",
                "middle_name": "",
                "last_name": "August",
                "country": "US",
                "region": "NY",
                "city": "Brooklyn",
                "street": "Westminster ave.",
                "building": "",
                "office": "",
                "zip": "11230",
                "phone": "+16030000000",
                "email": "test@example.com",
                "status": "deleted",
                "balance": "0.0",
                "usable_balance": "0.0",
                "current_debt": 0,
                "subscription_credit_limit": 0,
                "financial_blocking_threshold": 100,
                "account_type_id": 1564,
                "manager_id": 223,
                "owner_id": 847,
                "tech_user_id": 847,
                "bill_user_id": 847,
                "custom_attributes": {
                    "inn": "00012345678"
                },
                "manager": {
                    "created_at": "2020-04-01T11:14:21.837+03:00",
                    "updated_at": "2019-12-30T14:40:31.322+03:00",
                    "reseller_id": 1,
                    "id": 223,
                    "name": "Bill Toss",
                    "status": "active",
                    "email": "manager@example.by",
                    "role": "sales",
                    "custom_attributes": {
                        "ManagerString": "Test"
                    }
                },
                "owner": {
                    "created_at": "2016-10-26T17:38:37.551+03:00",
                    "updated_at": "2016-12-23T15:04:48.172+03:00",
                    "email": "owner@example.by",
                    "account_status": "active",
                    "global_status": "active",
                    "first_name": "Alex",
                    "middle_name": "",
                    "last_name": "Owner"
                },
                "default_payment_model": "prepay",
                "account_type": {
                    "id": 1564,
                    "name": "Физическое лицо",
                    "created_at": "2017-03-20T16:34:28.163+03:00",
                    "updated_at": "2017-03-20T16:34:28.163+03:00",
                    "reseller_id": 1,
                    "name_pattern": "%first_name %middle_name %last_name",
                    "primary_name": "",
                    "key": "personal",
                    "default_payment_method_id": null,
                    "ancestry": "1562",
                    "use_by_default": false
                },
                "account_class": {
                    "id": 1,
                    "reseller_id": 1,
                    "name": "Default",
                    "created_at": "2016-08-25T09:26:12.820+03:00",
                    "updated_at": "2019-10-27T10:58:46.758+03:00",
                    "financial_blocking_threshold": "100.0",
                    "due_order_period": 90,
                    "subzero_period": 1,
                    "stop_subscription_type": "automatically",
                    "key": "default",
                    "color": "grey",
                    "guaranteed_payment_limit": 1000,
                    "guaranteed_payment_period": 7,
                    "delete_subscription_type": "automatically",
                    "denominated": false,
                    "buy_with_negative_balance": false,
                    "receipt_day": null,
                    "payment_model": "prepay",
                    "default": true,
                    "due_payment_period": 30,
                    "subscription_credit_limit": "0.0"
                }
            },
            "relationships": {
                "subscriptions": {
                    "data": [
                        {
                            "id": "3005606",
                            "type": "subscriptions"
                        }
                    ]
                }
            }
        },
        {
            "id": "503",
            "type": "accounts",
            "attributes": {
                "created_at": "2019-08-22T15:59:53.492+03:00",
                "updated_at": "2019-09-20T10:50:27.033+03:00",
                "reseller_id": 1,
                "name": "Vit  Ada",
                "account_class_id": 1687,
                "primary_name": "DepV0304-4",
                "first_name": "Vit",
                "middle_name": "",
                "last_name": "Ada",
                "country": "TW",
                "region": "Московская",
                "city": "Москва",
                "street": "Первая",
                "building": "",
                "office": "",
                "zip": "119002",
                "phone": "+74950000001",
                "email": "test@example.com",
                "status": "active",
                "balance": "-4.0",
                "usable_balance": "-4.0",
                "current_debt": 3,
                "subscription_credit_limit": 0,
                "financial_blocking_threshold": 10,
                "account_type_id": 1564,
                "manager_id": 223,
                "owner_id": 866,
                "tech_user_id": 866,
                "bill_user_id": 866,
                "custom_attributes": {},
                "manager": {
                    "created_at": "2020-04-01T11:14:21.837+03:00",
                    "updated_at": "2019-12-30T14:40:31.322+03:00",
                    "reseller_id": 1,
                    "id": 223,
                    "name": "Bill Toss",
                    "status": "active",
                    "email": "manager@example.by",
                    "role": "sales",
                    "custom_attributes": {
                        "ManagerString": "Test"
                    }
                },
                "owner": {
                    "created_at": "2016-10-26T17:38:37.551+03:00",
                    "updated_at": "2016-12-23T15:04:48.172+03:00",
                    "email": "owner@example.by",
                    "account_status": "active",
                    "global_status": "active",
                    "first_name": "Alex",
                    "middle_name": "",
                    "last_name": "Owner"
                },
                "default_payment_model": "prepay",
                "account_type": {
                    "id": 1564,
                    "name": "Физическое лицо",
                    "created_at": "2017-03-20T16:34:28.163+03:00",
                    "updated_at": "2017-03-20T16:34:28.163+03:00",
                    "reseller_id": 1,
                    "name_pattern": "%first_name %middle_name %last_name",
                    "primary_name": "",
                    "key": "personal",
                    "default_payment_method_id": null,
                    "ancestry": "1562",
                    "use_by_default": false
                },
                "account_class": {
                    "id": 1687,
                    "reseller_id": 1,
                    "name": "Prepay",
                    "created_at": "2019-02-09T10:23:10.267+03:00",
                    "updated_at": "2019-09-20T10:48:33.157+03:00",
                    "financial_blocking_threshold": "10.0",
                    "due_order_period": 8,
                    "subzero_period": 1,
                    "stop_subscription_type": "automatically",
                    "key": "Prepay",
                    "color": "grey",
                    "guaranteed_payment_limit": 1000,
                    "guaranteed_payment_period": 7,
                    "delete_subscription_type": "automatically",
                    "denominated": false,
                    "buy_with_negative_balance": false,
                    "receipt_day": null,
                    "payment_model": "prepay",
                    "default": false,
                    "due_payment_period": 30,
                    "subscription_credit_limit": "0.0"
                }
            },
            "relationships": {
                "subscriptions": {
                    "data": [
                        {
                            "id": "3005649",
                            "type": "subscriptions"
                        }
                    ]
                }
            }
        }
    ],
    "included": [
        {
            "id": "3005606",
            "type": "subscriptions",
            "attributes": {
                "created_at": "2019-08-19T15:12:05.525024+0300",
                "updated_at": "2019-08-19T15:12:05.525024+0300",
                "auto_renewal": false,
                "billing_from": null,
                "expiration_date": null,
                "name": "Office USA monthly",
                "renew_point_days": 0,
                "start_date": null,
                "status": "deleted",
                "payment_model": "prepay",
                "payment_model_parameters": {}
            }
        },
        {
            "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",
                "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": 3
                }
            }
        }
    ],
    "links": {
        "self": "https://test.activeplatform.com/api/v3/resellers/1/accounts?filter%5Bemail%5D=test%40example.com&include=subscriptions&page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "first": "https://test.activeplatform.com/api/v3/resellers/1/accounts?filter%5Bemail%5D=test%40example.com&include=subscriptions&page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "prev": null,
        "next": null,
        "last": "https://test.activeplatform.com/api/v3/resellers/1/accounts?filter%5Bemail%5D=test%40example.com&include=subscriptions&page%5Bnumber%5D=1&page%5Bsize%5D=2"
    }
}