Update account
The Update account method is used for updating information about an 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 role and access level of the manager, which determine the availability of a method.
- The current reseller and downstream resellers accessible within a method.
PATCH {base_url}/api/v3/resellers/{reseller_id}/accounts/{account_id}
Arguments
Name | Parameter Type | Data type | Required/ | Description | ||||
---|---|---|---|---|---|---|---|---|
X-Api-Token | header | string | Required | API token of a manager that performs the operation (see Viewing and updating manager's information) | ||||
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) | ||||
account_id | path | integer | Required | Account ID | ||||
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 | Optional | The first name of the contract person | ||||
middle_name | form | string | Optional | The middle name of the contract person | ||||
last_name | form | string | Optional | The last name of the contract person | ||||
form | string | Optional | The email of the contract person | |||||
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 manager) | ||||
account_class_key | form | string | Optional | Account class key (see Account classes) | ||||
tech_user_id | form | integer | Optional | ID of the user referred to as the Tech contact | ||||
bill_user_id | form | integer | Optional | ID of the user referred to as the Billing contact | ||||
country | form | string | Optional | 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 | Optional | Contact information: Region | ||||
city | form | string | Optional | Contact information: City | ||||
street | form | string | Optional | Contact information: Street | ||||
building | form | string | Optional | Contact information: Building | ||||
office | form | string | Optional | Contact information: Office | ||||
zip | form | string | Optional | Contact information: Zip-code | ||||
phone | form | string | Optional | Contact information: Phone number:
| ||||
financial_blocking_threshold_use_system | form | bool | Optional | Defines whether the account uses the default financial blocking threshold value that is set in the account class:
| ||||
financial_blocking_threshold | form | float | Optional | The value of the financial blocking threshold for the account that is redefined on the account level. Required if | ||||
subscription_credit_limit_use_system | form | bool | Optional | Defines whether the account uses the default subscription credit limit value that is set in the account class:
| ||||
subscription_credit_limit | form | float | Optional | The value of the subscription credit limit for the account that is redefined on the account level. Required if | ||||
account_product_managers | form | object | Optional | Responsible managers of the account (see Managing responsible managers) | ||||
data | form | array | Optional | Information about responsible managers of the account | ||||
product_id | form | integer | Optional | Product ID | ||||
manager_product_role_id | form | integer | Optional | Manager role ID within the product | ||||
responsible_product_manager_id | form | integer | Optional | Responsible manager ID within the product | ||||
custom_attributes | form | object | Optional | The additional attributes of the account | ||||
data | form | array | Optional | Information about the additional attributes of the account (see Managing attributes) | ||||
key | form | string | Optional | The key of the additional attribute of the account | ||||
value | form | string | Optional | 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 updated information about the specified account (see Get account).
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. | |
Account must have subscription on product to assign responsible product manager | If it is necessary to attach a responsible manager to an account, specify the following data:
| |
Such role is not configured in product | ||
Manager with id is not responsible product manager | ||
All validation errors for the account attributes are displayed similar to the Operator Control Panel (see Viewing and updating account's details in ActivePlatform. Operator Control Panel) |
Request example
PATCH /api/v3/resellers/1/accounts/800
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json
{
"data": {
"attributes": {
"phone": "+375290000000"
}
}
}
Response example
{
"data": {
"id": "800",
"type": "accounts",
"attributes": {
"created_at": "2020-11-19T11:42:21.438+03:00",
"updated_at": "2020-11-19T11:52:01.470+03:00",
"reseller_id": 1,
"name": "Velma Hoppe",
"account_class_id": 2121,
"primary_name": "",
"first_name": "Velma",
"middle_name": "",
"last_name": "Hoppe",
"country": "BY",
"region": "Minsk",
"city": "Minsk",
"street": "Mira",
"building": "1",
"office": "2",
"zip": "220000",
"phone": "+375290000000",
"email": "Mikel.Koss@example.org",
"status": "active",
"balance": "0.0",
"usable_balance": "0.0",
"current_debt": 0,
"subscription_credit_limit": 10000,
"financial_blocking_threshold": 0,
"account_type_id": 1,
"manager_id": 261,
"owner_id": 992,
"tech_user_id": 992,
"bill_user_id": 992,
"custom_attributes": {
"signer_first_name": "Signer"
},
"manager": {
"created_at": "2019-12-30T14:41:54.938+03:00",
"updated_at": "2020-11-04T14:20:57.430+03:00",
"reseller_id": 1,
"id": 261,
"name": "Annamae Nicolas",
"status": "active",
"email": "sales@manager.com",
"role": "sales",
"phone": null,
"photo": null,
"manager_key": "test",
"custom_attributes": {
"test": "1"
}
},
"owner": {
"created_at": "2020-11-19T11:42:21.421+03:00",
"updated_at": "2020-11-19T11:42:21.421+03:00",
"email": "kristoffer.haag@example.com",
"account_status": "active",
"global_status": "active",
"first_name": "Carlo",
"middle_name": "",
"last_name": "Yundt"
},
"account_product_managers": [],
"self_registration": false,
"default_payment_model": "postpay",
"account_type": {
"id": 1,
"name": "Personal",
"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": []
}
}
}
}