Create account

The Create account method is used for creating a new account of the current reseller or any of its downstream resellers.

The account will be created without the Terms and Conditions agreement accepted. On the first signing in to the Customer Control Panel, the account will be prompted to accept the agreement (see Log in to the Customer Control Panel).

A new user with the Owner access rights will be created with the Privacy Policy agreement accepted.

The account will be created with the Work permit for postpaid = Verification not performed parameter (see Managing account's permission to use the Postpay model).

XML
POST {{base_url}}/api/v3/resellers/{{reseller_id}}/accounts

Authentication

This endpoint requires a JWT access token. Specify the token in the Authorization header using the Bearer authentication scheme:

Authorization: Bearer <JWT_ACCESS_TOKEN>

In Postman, select Bearer Token on the Authorization tab and enter the JWT access token.

Arguments

Name

Parameter Type

Data type

Required/ 
Optional

Description

Content-Type

header

string

Required

Media type of the request. Specify the following: application/vnd.api+json

Accept

header

string

Required

Supported media types of the answer. Specify the following: application/vnd.api+json

base_url

path

string

Required

ActivePlatform URL

reseller_id

path

integer

Required

ID of the current reseller or any of its downstream resellers (see Viewing and updating reseller general information)

data

form

object

Required

Information about the attributes of the operation


attributes

form

object

Required

Attributes of the operation



account_type_id

form

integer

Required

Account type ID (see Viewing the list of account types)



primary_name

form

string

Optional

Primary name of the account (for example, a company name, if the customer is a legal entity)

Using special characters, abbreviations, and TLDs in a company name may be limited by the global settings of the installation (see account validation settings in Global settings).



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



email

form

string

Required

The email of the contract person



owner_id

form

integer

Optional

The ID of an existing user that will be attached to the account and granted the Owner access rights in the Customer Control Panel. Required when a new Owner is not created



new_owner_first_name

form

string

Optional

The first name of a new user that will be created and attached to the account and granted the Owner access rights in the Customer Control Panel. Required when owner_id is not specified



new_owner_middle_name

form

string

Optional

The middle name of a new user that will be created and attached to the account and granted the Owner access rights in the Customer Control Panel. Can be specified optionally when owner_id is not specified



new_owner_last_name

form

string

Optional

The last name of a new user that will be created and attached to the account and granted the Owner access rights in the Customer Control Panel. Required when owner_id is not specified



new_owner_email

form

string

Optional

The email of a new user that will be created and attached to the account and granted the Owner access rights in the Customer Control Panel. Required when owner_id is not specified



manager_id

form

integer

Optional

ID of a manager that will be linked to the account

A manager should have the Sales person role and the Active status (see Get manager)



account_class_key

form

string

Required

Account class key (see Account classes)



country

form

string

Required

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

The reseller may limit the list of countries available for creating a new account. See the Region settings section in General system settings.



region

form

string

Required

Contact information: Region



city

form

string

Required

Contact information: City



street

form

string

Required

Contact information: Street



building

form

string

Optional

Contact information: Building



office

form

string

Optional

Contact information: Office



zip

form

string

Required

Contact information: Zip-code



phone

form

string

Required

Contact information: Phone number:

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

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



custom_attributes

form

object

Optional

Information about the additional attributes of the account (see Managing attributes)




data

form

array

Optional

The additional attributes of the account





key

form

string

Depends on the account type

The key of the additional attribute of the account





value

form

string

Depends on the account type

The value of the additional attribute of the account.

Depending on the value type, the value is specified in the following formats:

  • Checkbox:

    • 1 for true.

    • 0 for false.

  • Date: DD.MM.YYYY.

  • List: Key of the element.

Response model

If no errors are encountered, the method returns data as the information about the created account (see Get account). Status: 201 Created.

Errors

Status

Error text

Comment

422

Manager to attach must be a 'sales person' and be in 'active' status

If it is necessary to attach a manager to the account, specify the ID of a manager that has the Sales person role and the Active status (see Get manager)

Available options: <list of countries>

The reseller limited the list of countries available for creating a new account. See the Region settings section in General system settings.

All validation errors for the account attributes are displayed similar to the Operator Control Panel (see Creating an account).

Request example

XML
POST /api/v3/resellers/1/accounts
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
Authorization: Bearer <JWT_ACCESS_TOKEN>
Accept: application/vnd.api+json
JSON
JSON
{
    "data": {
        "attributes": {
            "account_type_id": 1,
            "first_name": "Clotilde",
            "middle_name": "",
            "last_name": "Ledner",
            "email": "ClotildeLedner@example.com",
            "new_owner_first_name": "Alba",
            "new_owner_middle_name": "",
            "new_owner_last_name": "Stehr",
            "new_owner_email": "AlbaStehr@example.com",
            "manager_id": 188,
            "account_class_key": "postpaytest",
            "country": "BY",
            "region": "Minsk",
            "city": "Minsk",
            "street": "Mira",
            "building": "1",
            "office": "2",
            "zip": "220000",
            "phone": "+375290000000",
            "custom_attributes": {
                "data": [
                    {
                        "key": "signer_name",
                        "value": "Signer"
                    }
                ]
            }
        }
    }
}

Response example

JSON
{
    "data": {
        "id": "789",
        "type": "accounts",
        "attributes": {
            "created_at": "2021-02-11T10:18:19.148+03:00",
            "updated_at": "2021-02-11T10:18:19.180+03:00",
            "reseller_id": 1,
            "name": "Clotilde  Ledner",
            "account_class_id": 2121,
            "primary_name": "",
            "first_name": "Clotilde",
            "middle_name": "",
            "last_name": "Ledner",
            "country": "BY",
            "region": "Minsk",
            "city": "Minsk",
            "street": "Mira",
            "building": "1",
            "office": "2",
            "zip": "220000",
            "phone": "+375290000000",
            "email": "ClotildeLedner@example.com",
            "status": "active",
            "balance": "0.0",
            "usable_balance": "0.0",
            "current_debt": 0.0,
            "subscription_credit_limit": 10000.0,
            "financial_blocking_threshold": 0.0,
            "account_type_id": 1,
            "manager_id": 188,
            "owner_id": 987,
            "tech_user_id": 987,
            "bill_user_id": 987,
            "custom_attributes": {
                "signer_name": "Signer"
            },
            "manager": {
                "created_at": "2017-10-12T15:27:56.354+03:00",
                "updated_at": "2020-08-07T05:32:53.522+03:00",
                "reseller_id": 1,
                "id": 188,
                "name": "Alena R",
                "status": "active",
                "email": "alena87@example.com",
                "role": "sales",
                "phone": null,
                "photo": null,
                "custom_attributes": {
                    "manager": ""
                }
            },
            "owner": {
                "created_at": "2021-02-11T10:18:19.128+03:00",
                "updated_at": "2021-02-11T10:18:19.128+03:00",
                "email": "AlbaStehr@example.com",
                "account_status": "active",
                "global_status": "active",
                "first_name": "Alba",
                "middle_name": "",
                "last_name": "Stehr"
            },
			"account_product_managers": [],
			"self_registration": false,
            "default_payment_model": "postpay",
            "account_type": {
                "id": 1,
                "name": "Personal BLR",
                "created_at": "2016-08-25T09:26:12.658+03:00",
                "updated_at": "2019-10-02T03:30:11.716+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": 2121,
                "reseller_id": 1,
                "name": "POSTPAY",
                "created_at": "2019-12-20T08:52:04.909+03:00",
                "updated_at": "2019-12-20T08:59:36.544+03:00",
                "financial_blocking_threshold": "0.0",
                "due_order_period": 15,
                "subzero_period": 1,
                "stop_subscription_type": "automatically",
                "key": "postpaytest",
                "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": "postpay",
                "default": false,
                "due_payment_period": 3,
                "subscription_credit_limit": "10000.0"
            }
        },
        "relationships": {
            "subscriptions": {
                "data": []
            }
        }
    }
}