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/ 
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)
account_idpathintegerRequiredAccount ID
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_nameformstringOptionalThe first name of the contract person


middle_nameformstringOptionalThe middle name of the contract person


last_nameformstringOptionalThe last name of the contract person


emailformstringOptionalThe 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

OptionalID of the user referred to as the Tech contact


bill_user_id

form

integer

OptionalID 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:

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


financial_blocking_threshold_use_systemformboolOptional

Defines whether the account uses the default financial blocking threshold value that is set in the account class:

  • true — the account uses the financial blocking threshold value that is set in the account class.
  • false — the account uses the financial blocking threshold value that is redefined on the account level.


financial_blocking_thresholdformfloatOptional

The value of the financial blocking threshold for the account that is redefined on the account level.

Required if financial_blocking_threshold_use_system = false



subscription_credit_limit_use_systemformboolOptional

Defines whether the account uses the default subscription credit limit value that is set in the account class:

  • true — the account uses the subscription credit limit value that is set in the account class.
  • false — the account uses the subscription credit limit value that is redefined on the account level.


subscription_credit_limitformfloatOptional

The value of the subscription credit limit for the account that is redefined on the account level.

Required if subscription_credit_limit_use_system = false



account_product_managersformobjectOptionalResponsible managers of the account (see Managing Responsible Managers)



dataformarrayOptionalInformation about responsible managers of the account




product_idformintegerOptionalProduct ID




manager_product_role_idformintegerOptionalManager role ID within the product




responsible_product_manager_idformintegerOptionalResponsible manager ID within the product


custom_attributesformobjectOptionalThe additional attributes of the account



dataformarrayOptional

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





keyform

string

Optional

The key of the additional attribute of the account




valueform

string

Optional

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 updated information about the specified account (see Get account).

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.
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:

  1. ID of a product linked to a confirmed Sales Order of the account (see Get list of orders).
  2. ID of a manager role existing within the specified product (see Managing Roles of Responsible managers).
  3. ID of a user assigned to the specified product as a responsible manager with the specified manager role (see Managing Responsible Managers).
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 an 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": []
            }
        }
    }
}