Get a List of the Reseller's Accounts

The Get a List of the Reseller's Accounts API method returns the list of Plans 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_idpathintegerRequiredID of the current Reseller or any of its downstream Resellers (see Viewing and updating reseller general information)
page[size]queryintegerOptionalPage navigation: number of elements per page. The default value is 50
page[number]queryintegerOptionalPage navigation: page number

Response model

Name

Data type

Description

dataarrayResponse data


id

integer

Account ID

typestringData type

attributesobjectAccount information


created_at

date

Date and time of Account creation


updated_at

date

Data and time of Account last update


reseller_idintegerID of the Account's Reseller


namestringAccount name


account_class_idintegerAccount Class ID


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


first_name

string

Account Owner first name


middle_name

string

Account Owner middle name


last_name

string

Account Owner last name


countrystring

Account address. The country field contains the two-letter country code according to the ISO 3166-1 alpha-2 standard



regionstring


citystring


streetstring


buildingstring


officestring


zipstringZip code


phonestring

Account phone number:

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


email

string

Account contact email


status

string

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



balancefloatAccount balance


credit_limitfloatAccount Credit limit


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


manager_idintegerAccount's Manager ID


owner_idintegerAccount's Owner ID


tech_user_idinteger

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



bill_user_idintegerID 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']stringAccount Attribute value


managerarray

Information about the Account's Manager




created_atdateDate and time of the Manager creation



updated_atdateData and time of the Manager last update



reseller_idintegerID of the Manager's Reseller



idintegerID 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


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



idintegerID of the Account Type



namestringName of the Account Type



created_atdateDate and time of the Account Type creation



updated_atdateDate and time when the Account Type was updated



reseller_idintegerID 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_idintegerID of the default Payment method (see Configuring payment methods)



ancestrystringID of the parent Account Type


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



idintegerID of the Account Class



reseller_idintegerID of the linked Reseller



namestringName of the Account Class



created_atdateDate and time of the Account Type creation



updated_atdateDate and time when the Account Type was updated



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



subzero_periodintegerNumber 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_limitintegerMaximum amount of the Guaranteed Payment that all Accounts, which are added to the Account Class, can use



guaranteed_payment_periodintegerNumber 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
  • true - the Account Type is denominated



buy_with_negative_balancebool

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

  • false - paying for Orders with the negative Account Balance is not available
  • true - paying for Orders with the negative Account Balance is available



receipt_dayintegerDeprecated



payment_modelstring

Payment model:

  • postpay
  • prepay



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



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



credit_limitfloatCredit limit, within which the Account balance can be negative without moving the Account to the Credit hold status

relationships

arrayInformation about the related objects


subscriptions
arrayInformation about the related Subscriptions



dataarrayInformation about the Subscription




idintegerID of the Subscription




typestringData type
linksarrayPage navigation links that use the defined page navigation parameters

selfstringCurrent page link

firststringCurrent page link

prevstringPrevious page link

nextstringNext page link

laststringLast page link

Request example

GET /api/v3/resellers/1/accounts?page[size]=2&page[number]=87
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json

Response example

{
    "data": [
        {
            "id": "167",
            "type": "accounts",
            "attributes": {
                "created_at": "2017-08-16T12:48:21.629+03:00",
                "updated_at": "2020-03-02T01:18:33.431+03:00",
                "reseller_id": 1,
                "name": "Renew  1",
                "account_class_id": 1,
                "primary_name": "",
                "first_name": "Renew",
                "middle_name": "",
                "last_name": "1",
                "country": "BY",
                "region": "1",
                "city": "2",
                "street": "3",
                "building": "",
                "office": "29",
                "zip": "200000",
                "phone": "+375292000000",
                "email": "example@gmail.com",
                "status": "active",
                "balance": "123423.0",
                "credit_limit": 0.0,
                "account_type_id": 1,
                "manager_id": 50,
                "owner_id": 447,
                "tech_user_id": 447,
                "bill_user_id": 447,
                "custom_attributes": {
                    "passport_number": "12345678",
                    "passport_issued_by": "432",
                    "passport_date_of_issue": "22.08.2017",
                    "personal_number": "1234123",
                    "birth_date": "03.08.1977",
                    "invoice": "0",
                    "dns": "0"
                },
                "manager": {
                    "created_at": "2016-11-30T13:16:27.169+03:00",
                    "updated_at": "2019-05-29T10:24:04.734+03:00",
                    "reseller_id": 1,
                    "id": 50,
                    "name": "Sales Manager",
                    "status": "active",
                    "email": "test@gmail.com",
                    "role": "sales",
                    "custom_attributes": {
                        "manager": "",
                        "m_anager": "",
                        "manager_attribute": "1"
                    }
                },
                "account_type": {
                    "id": 1,
                    "name": "Personal BLR",
                    "created_at": "2016-08-25T09:26:12.658+03:00",
                    "updated_at": "2019-05-08T07:21:42.843+03:00",
                    "reseller_id": 1,
                    "name_pattern": "%first_name %middle_name %last_name",
                    "primary_name": "",
                    "key": "personalblr",
                    "default_payment_method_id": 2,
                    "ancestry": null,
                    "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-08-21T11:35:12.367+03:00",
                    "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": true,
                    "receipt_day": null,
                    "payment_model": "prepay",
                    "default": false,
                    "due_payment_period": 30,
                    "credit_limit": "0.0"
                }
            },
            "relationships": {
                "subscriptions": {
                    "data": [
                        {
                            "id": "3002319",
                            "type": "subscriptions"
                        }
                    ]
                }
            }
        },
        {
            "id": "174",
            "type": "accounts",
            "attributes": {
                "created_at": "2017-08-31T16:36:02.991+03:00",
                "updated_at": "2019-02-01T16:51:37.442+03:00",
                "reseller_id": 1,
                "name": "younes  pak",
                "account_class_id": 1,
                "primary_name": "",
                "first_name": "younes",
                "middle_name": "",
                "last_name": "pak",
                "country": "BY",
                "region": "minsk",
                "city": "minsk",
                "street": "minskaya",
                "building": "123",
                "office": "29",
                "zip": "213451",
                "phone": "+375290000000",
                "email": "example@example.com",
                "status": "inactive",
                "balance": "20000.0",
                "credit_limit": 0.0,
                "account_type_id": 1564,
                "manager_id": null,
                "owner_id": 467,
                "tech_user_id": 467,
                "bill_user_id": 467,
                "custom_attributes": {},
                "manager": null,
                "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"
                },
                "account_class": {
                    "id": 1,
                    "reseller_id": 1,
                    "name": "Default",
                    "created_at": "2016-08-25T09:26:12.820+03:00",
                    "updated_at": "2019-08-21T11:35:12.367+03:00",
                    "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": true,
                    "receipt_day": null,
                    "payment_model": "prepay",
                    "default": false,
                    "due_payment_period": 30,
                    "credit_limit": "0.0"
                }
            },
            "relationships": {
                "subscriptions": {
                    "data": [
                        {
                            "id": "3002151",
                            "type": "subscriptions"
                        },
                        {
                            "id": "3002152",
                            "type": "subscriptions"
                        },
                        {
                            "id": "3002150",
                            "type": "subscriptions"
                        },
                        {
                            "id": "3002154",
                            "type": "subscriptions"
                        }
                    ]
                }
            }
        }
    ],
    "links": {
        "self": "https://test.activeplatform.com/api/v3/resellers/1/accounts?page%5Bnumber%5D=87&page%5Bsize%5D=2",
        "first": "https://test.activeplatform.com/api/v3/resellers/1/accounts?page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "prev": "https://test.activeplatform.com/api/v3/resellers/1/accounts?page%5Bnumber%5D=86&page%5Bsize%5D=2",
        "next": "https://test.activeplatform.com/api/v3/resellers/1/accounts?page%5Bnumber%5D=88&page%5Bsize%5D=2",
        "last": "https://test.activeplatform.com/api/v3/resellers/1/accounts?page%5Bnumber%5D=153&page%5Bsize%5D=2"
    }
}