Get a List of Accounts
The Get a List of Accounts method returns List of Accounts that have been created in the paltform.
The List of Accounts can be shown page by page. To split by page, the following Arguments should be passed:
- the page number (page);
- the amount of items per page (per_page).
The List of Accounts can be sorted by any field. To sort the List of Accounts, the following Arguments should be passed:
- the field name that is used for sorting (sorting[field]);
- the sort direction (sorting[reversed]):
- true - the list will be sorted in descending direction;
- false - the list will be sorted in ascending direction (by default).
The List of Accounts can be filtered by:
- creation date (filters[created_at]);
- update date (filters[updated_at]);
- status (filters[status]);
- email (filters[email]).
GET /api/vendor/v1/accounts.json?api_token={api_token}
Arguments
Name | Parameter Type | Data type | Required/ | Description |
---|---|---|---|---|
api_token | query | string | Required | API token of the manager who perform the operation (see API Token Authentication). |
page | query | integer | Optional | Returning a list of accounts by current page number. |
per_page | query | integer | Optional | Setting a number of items in the page. |
sorting[field] | query | string | Optional | Sorting the list by a specified field. |
sorting[reversed] | query | string | Required | Setting the sorting mode:
|
filters[created_at] | query | date | Optional | Filtering the list by a creation date. |
filters[updated_at] | query | date | Optional | Filtering the list by an update date. |
filters[status] | query | string | Optional | Filtering the list by a status. |
filters[email] | query | string | Optional | Filtering the list by an email. |
Response model
Name | Data type | Description |
---|---|---|
id | integer | An account ID. |
name | string | An account name. |
account_class_id | integer | An account class ID (see Account classes in the ActivePlatform. Operator Control Panel). |
account_class | string | A name of the account class (see Account classes in the ActivePlatform. Operator Control Panel). |
primary_name | string | A company name, if the customer is a legal entity. |
first_name | string | The first name for the user the owner access rights. |
middle_name | string | The middle name for the user the owner access rights. |
last_name | string | The last name for the user the owner access rights. |
country | string | An account address: a two-letter ISO code ISO 3166-1 alpha-2 of the country. |
region | string | An account address: a region. |
city | string | An account address: a city. |
street | string | An account address: a street. |
building | string | An account address: building. |
office | string | An account address: office. |
zip | string | An account address: a zip-code. |
phone | string | A phone number of the account:
|
string | A contact email of the account. | |
status | string | A current account status:
|
balance | float | A current value of the account balance (see Viewing the List of Charges in the ActivePlatform. Operator Control Panel). |
credit_limit | float | A maximum amount of the credit that a customer can use for ordering services without topping up (the credit limit can be set manually or by default (see Account classes in the ActivePlatform. Operator Control Panel)). |
account_type_id | integer | An ID of the account type. |
account_type | string | A name of the account type. |
manager_id | integer | A manager ID who is linked with the account. |
owner_id | integer | An ID of the existed user who is granted the owner access rights in the Customer Control Panel. |
tech_user_id | integer | An ID of the user, which is responsible for the technical matters. |
bill_user_id | integer | An ID of the user, which is responsible for the financial matters. |
custom_attributes | array | A list of additional attributes (see Managing attributes in the ActivePlatform. Operator Control Panel):
|
created_at | date | A date and time of the account's creation. |
updated_at | date | A date and time, when the account information was updated. |
Request example
http://billing.activeplatform.com:80/api/vendor/v1/accounts.json?api_token=654321
Response example
[
{
"id": 2000036,
"name": "INVOICE",
"account_class_id": 1,
"account_class": "Default",
"primary_name": "INVOICE",
"first_name": "John",
"middle_name": "Aleksandrovich",
"last_name": "Doe",
"country": "BY",
"region": "Minskая",
"city": "Minsk",
"street": "Lenina",
"building": "6",
"office": "1",
"zip": "220006",
"phone": "+375330141111",
"email": "john.doe@gmail.com",
"status": "active",
"balance": "23.34",
"credit_limit": "0.0",
"account_type_id": 2000045,
"account_type": "Individual Entrepreneur",
"manager_id": 2000157,
"owner_id": 2000094,
"tech_user_id": 2000092,
"bill_user_id": 2000092,
"custom_attributes": {
"passport_date_of_issue": "14.05.2014",
"personal_number": "123123123",
"birth_date": "12.02.1992",
"unp": ""
},
"created_at": "2014-12-01T16:32:51.728+03:00",
"updated_at": "2016-01-13T15:16:04.102+03:00"
}
]