Create a Reseller's Account
The Create a Reseller's Account method is used for creating a new Account 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.
POST {base_url}/api/v3/resellers/{reseller_id}/accounts
Arguments
Name | Parameter Type | Data type | Required/ | Description | ||||
---|---|---|---|---|---|---|---|---|
X-Api-Token | header | string | Required | API token of the Manager that performs the operation (see Viewing and updating manager's information) | ||||
Content-Type | header | string | Required | Indicates the media type (text/html or text/JSON) of the request that is sent to the server by the client (browser) | ||||
Accept | header | string | Required | Information about data types that the client (browser) supports | ||||
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) | ||||
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 | ||||
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 the Manager that will be linked to the Account A Manager should have the Sales person role and the Active status (see Get the Reseller's Manager by ID) | ||||
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:
| ||||
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:
|
Response model
If no errors are encountered, the method returns data as the information about the created Account (see Get the Reseller's Account Information by ID). 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 Log in to the Customer Control Panel).
A new User with the Owner access rights will be created with the Privacy Policy agreement accepted.
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 the Reseller's Manager by ID) |
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 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": [],
"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": []
}
}
}
}