Create an Account
The Create an Account method allows adding a new Account. It is necessary to set the Owner of the Account by using the ID of an existing User or creating a new User. Depending on an Account type, additional parameters for a new Account may be required (see Managing attributes in the ActivePlatform. Operator Control Panel).
POST /api/vendor/v1/accounts.json?api_token={api_token}
Arguments
Name | Parameter Type | Data type | Required/Optional | Description | |
---|---|---|---|---|---|
api_token | query | string | Required | API token of the manager who performs the operation (see API Token Authentication) | |
account_type_id | form | integer | Required | Account type ID | |
primary_name | form | string | Optional | Primary name of the Account (for example, a company name, if the customer is a legal entity) | |
first_name | form | string | Required | The first name of the contract person | |
middle_name | form | string | Optional | The middle name of the contract person | |
last_name | form | string | Required | The last name of the contract person | |
owner_id | form | integer | Optional | The ID of an existing User who will be granted the Owner access rights in the Customer Control Panel. Used if a new Owner is not created | |
new_owner_first_name | form | string | Optional | The first name of the Owner if a new Owner is created | |
new_owner_last_name | form | string | Optional | The middle name of the Owner if a new Owner is created | |
new_owner_middle_name | form | string | Optional | The last name of the Owner if a new Owner is created | |
new_owner_email | form | string | Optional | The Email of the Owner if a new Owner is created | |
manager_id | form | integer | Optional | ID of the manager who is linked with the Account | |
account_class_id | form | integer | Required | Account class ID (see Account classes) | |
country | form | string | Required | Contact information: a two-letter ISO code ISO 3166-1 alpha-2 of the country | |
region | form | string | Required | Contact information: Region | |
city | form | string | Required | Contact information: City | |
street | form | string | Required | Contact information: Street | |
building | form | string | Required | Contact information: Building | |
office | form | string | Required | Contact information: Office | |
zip | form | string | Required | Contact information: Zip-code | |
phone | form | string | Required | Contact information: Phone number:
| |
form | string | Required | Email of the contract person | ||
billing_day | form | integer | Optional | A day of the month when the invoices are created | |
custom_attributes | form | array | Depends on the Account type | A list of additional attributes (see Managing attributes) | |
key | form | string | Depends on the Account type | The key that is used to determine the element via API (see Creating an attribute) | |
value | form | Depends on the attribute | Depends on the Account type | A value of the attribute |
Response model
Name | Data type | Description | |
---|---|---|---|
id | integer | Account ID | |
name | string | Account name | |
account_class_id | integer | Account class ID (see Account classes) | |
account_class | string | Account class name (see Account classes) | |
primary_name | string | Account primary name (a company name, if the customer is a legal entity) | |
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 | |
country | string | Contact information: a two-letter ISO code ISO 3166-1 alpha-2 of the country | |
region | string | Contact information: Region | |
city | string | Contact information: City | |
street | string | Contact information: Street | |
building | string | Contact information: Building | |
office | string | Contact information: Office | |
zip | string | Contact information: Zip-code | |
phone | string | Contact information: Phone number:
| |
string | Email of the contract person | ||
status | string | Account status:
| |
balance | float | A current value of the Account balance (see Viewing the list of charges) | |
account_type_id | integer | Account type ID | |
account_type | string | Account type name | |
default_payment_model | string | Default payment model from the Account class:
| |
current_debt | float | Current debt of the Account for all postpaid Subscriptions | |
financial_blocking_threshold_use_system | bool | Shows whether the Account uses the default Financial blocking threshold value that is set in the Account class:
| |
financial_blocking_threshold | float | The value of the Financial blocking threshold for the Account that is set in the Account class or redefined on the Account level | |
subscription_credit_limit_use_system | bool | Shows whether the Account uses the default Subscription credit limit value that is set in the Account class or redefined on the Account level:
| |
subscription_credit_limit | float | The value of the Subscription credit limit for the Account that is set in the Account class or redefined on the Account level | |
manager_id | integer | ID of the manager who is linked with the Account | |
owner_id | integer | ID of the User who is granted the Owner access rights in the Customer Control Panel | |
tech_user_id | integer | ID of the user, which is responsible for the technical matters | |
bill_user_id | integer | ID of the user, which is responsible for the financial matters | |
custom_attributes | array | A list of additional attributes (see Managing attributes) | |
name | string | Attribute name | |
value | Depends on the attribute | Attribute value | |
created_at | date | Date and time of the Account creation | |
updated_at | date | Date and time, when the Account information was updated |
Request example
POST /api/vendor/v1/accounts.json?api_token=vY5fwetestK3gJXZH5uHCw
{
"account_type_id": 1,
"first_name": "Mark",
"last_name": "Doe",
"new_owner_first_name": "Backsplace",
"new_owner_last_name": "rdq",
"new_owner_email": "markn1234@activeplatform.com",
"account_class_id": 1,
"country": "BY",
"region": "Minsk",
"city": "Minsk",
"street": "Lenina",
"building": "1",
"office": "1",
"zip": "220007",
"phone": "+375290000000",
"email": "mark771234@activeplatform.com",
"custom_attributes": [
{
"key": "birth_date",
"value": "10.08.2016"
},
{
"key": "passport_date_of_issue",
"value": "01.07.2016"
},
{
"key": "passport_issued_by",
"value": "Goverment"
},
{
"key": "personal_number",
"value": "A4411111BB1122"
},
{
"key": "passport_number",
"value": "1124111111122"
}
]
}
Response example
If the Account is successfully created (status 201), the method returns:
{
"id": 505,
"name": "Mark Doe",
"account_class_id": 1,
"account_class": "Default",
"primary_name": "",
"first_name": "Mark",
"middle_name": null,
"last_name": "Doe",
"country": "BY",
"region": "Minsk",
"city": "Minsk",
"street": "Lenina",
"building": "1",
"office": "1",
"zip": "220007",
"phone": "+375290000000",
"email": "mark771234@activeplatform.com",
"status": "active",
"balance": "0.0",
"account_type_id": 1,
"account_type": "Personal BLR",
"default_payment_model": "prepay",
"current_debt": 0.0,
"financial_blocking_threshold_use_system": true,
"financial_blocking_threshold": 100.0,
"subscription_credit_limit_use_system": true,
"subscription_credit_limit": 0.0,
"manager_id": null,
"owner_id": 874,
"new_owner_first_name": "Backsplace",
"new_owner_last_name": "rdq",
"new_owner_middle_name": null,
"new_owner_email": "markn1234@activeplatform.com",
"tech_user_id": 874,
"bill_user_id": 874,
"custom_attributes": [
{
"name": "Personal number",
"value": "A4411111BB1122"
},
{
"name": "Birth day",
"value": "10.08.2016"
},
{
"name": "Issued",
"value": "01.07.2016"
},
{
"name": "Passport number",
"value": "1124111111122"
},
{
"name": "Issued by",
"value": "Government"
},
{
"name": "new DNS",
"value": ""
},
{
"name": "Invoices",
"value": ""
},
{
"name": "Tenant Name",
"value": ""
},
{
"name": "Tenant ID",
"value": ""
}
],
"created_at": "2019-10-15T13:08:36.440+03:00",
"updated_at": "2019-10-15T13:08:36.517+03:00"
}
If the Account is not created, the method returns the mistake description (for example, status 422):
{
"error": {
"location.country": [
"is not included in the list"
],
"location.phone": [
"is not in international format"
],
"custom_attributes.value": [
"can't be blank",
"is not included in the list"
],
"passport_date_of_issue": [
{
"value": [
"can't be blank",
"is not included in the list"
]
}
],
"personal_number": [
{
"value": [
"can't be blank"
]
}
],
"birth_date": [
{
"value": [
"can't be blank",
"is not included in the list"
]
}
],
"passport_number": [
{
"value": [
"can't be blank"
]
}
],
"passport_issued_by": [
{
"value": [
"can't be blank"
]
}
]
}
}