Create account

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

An API token of a manager is required for authorization. To get an API token via the Operator Control Panel, see Viewing and updating Manager's information

The manager's API token specified in an API request determines the current reseller and downstream resellers accessible within a method.

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

Arguments

Name

Parameter Type

Data type

Required/ 
Optional

Description

X-Api-TokenheaderstringRequiredAPI token of a manager that performs the operation (see Viewing and updating Manager's information)
Content-TypeheaderstringRequiredMedia type of the request. Specify the following: application/vnd.api+json
AcceptheaderstringRequired

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

base_urlpathstringRequiredActivePlatform URL
reseller_idpathintegerRequiredID of the current reseller or any of its downstream resellers (see Viewing and updating Reseller general information)
dataformobjectRequiredInformation about the attributes of the operation

attributesformobjectRequiredAttributes of the operation


account_type_idformintegerRequiredAccount type ID (see Viewing the List of Account Types)


primary_nameformstringOptional

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_nameformstringRequiredThe first name of the contract person


middle_nameformstringOptionalThe middle name of the contract person


last_nameformstringRequiredThe last name of the contract person


emailformstringRequiredThe email of the contract person


owner_idformintegerOptionalThe 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

formstringOptional

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

formstringOptionalThe 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

formstringOptionalThe 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

formstringOptional

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_attributesformobjectOptionalInformation about the additional attributes of the account (see Managing Attributes)



dataformarrayOptionalThe additional attributes of the account




keyform

string

Depends on the account type

The key of the additional attribute of the account




valueform

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.

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 Signing in to the Customer Control Panel).

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

Errors

StatusError textComment
422Manager to attach must be a 'sales person' and be in 'active' statusIf 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 in ActivePlatform. Operator (Reseller) Control Panel)

Request example

POST /api/v3/resellers/1/accounts
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+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

{
    "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": []
            }
        }
    }
}

Отзыв | Feedback