Update an Account
The Update an Account method allows to update an Account information.
PUT /api/vendor/v1/accounts/{id}.json?api_token={api_token}
Arguments
Name | Parameter Type | Data type | Required/Optional | Description |
---|---|---|---|---|
id | path | integer | Required | An account type ID. |
api_token | query | string | Required | API token of the manager who perform the operation (see API Token Authentication). |
manager_id | form | integer | Optional | A manager ID who will be linked with the account. |
account_type_id | form | integer | Optional | An account type ID. |
account_class_id | form | integer | Optional | An account class ID (see Account classes in the ActivePlatform. Operator Control Panel). |
primary_name | form | string | Optional | A company name, if the customer is a legal entity. |
first_name | form | string | Optional | The first name for the user the owner access rights. |
middle_name | form | string | Optional | The middle name for the user the owner access rights. |
last_name | form | string | Optional | The last name for the user the owner access rights. |
owner_id | form | integer | Optional | An ID of the existed user who will be granted the owner access rights in the Customer Control Panel. |
form | string | Optional | A contact email of the account. | |
credit_limit_use_system | form | boolean | Optional | The credit limit:
System value of the credit is set for all accounts, which belong to the particular Account Class (see Account classes). An Account can use funds within the credit limit only if the Pay with negative balance checkbox in the relevant Account Class is selected (see Creating an account class). If the Pay with negative balance checkbox is not selected then credit limit is ignored and Account Balance cannot become negative. |
credit_limit | form | string | Optional | A value of credit limit if the system value of credit limit is not used, the 'credit_limit_use_system' argument is set to 'false'. |
country | form | string | Optional | An account address: a two-letter ISO code ISO 3166-1 alpha-2 of the country. |
region | form | string | Optional | An account address: a region. |
city | form | string | Optional | An account address: a city. |
street | form | string | Optional | An account address: a street. |
building | form | string | Optional | An account address: building. |
office | form | string | Optional | An account address: office. |
zip | form | string | Optional | An account address: a zip-code. |
phone | form | string | Optional | A phone number of the account:
|
custom_attributes[][key] | form | string | Depends on ID of the account type | A list of additional attributes (see Managing attributes in the ActivePlatform. Operator Control Panel). The key that is used to determine the element in API (see Creating an attribute in the ActivePlatform. Operator Control Panel). |
custom_attributes[][value] | form | Depends on attribute | Depends on ID of the account type | A value of the attribute. |
Response model
Name | Data type | Description |
---|---|---|
id | integer | An account ID. |
name | string | An account name. |
account_class_id | integer | An account class ID (see Account classes in the ActivePlatform. Operator Control Panel). |
account_class | string | A name of the account class (see Account classes in the ActivePlatform. Operator Control Panel). |
primary_name | string | A company name, if the customer is a legal entity. |
first_name | string | The first name for the user the owner access rights. |
middle_name | string | The middle name for the user the owner access rights. |
last_name | string | The last name for the user the owner access rights. |
country | string | An account address: a two-letter ISO code ISO 3166-1 alpha-2 of the country. |
region | string | An account address: a region. |
city | string | An account address: a city. |
street | string | An account address: a street. |
building | string | An account address: building. |
office | string | An account address: office. |
zip | string | An account address: a zip-code. |
phone | string | A phone number of the account:
|
string | A contact email of the account. | |
status | string | A current account status:
|
balance | float | A current value of the account balance (see Viewing the List of Charges in the ActivePlatform. Operator Control Panel). |
credit_limit | float | A maximum amount of the credit that a customer can use for ordering services without topping up (the credit limit can be set manually or by default (see Account classes in the ActivePlatform. Operator Control Panel)). |
account_type_id | integer | An ID of the account type. |
account_type | string | A name of the account type. |
manager_id | integer | A manager ID who is linked with the account. |
owner_id | integer | An ID of the existed user who is granted the owner access rights in the Customer Control Panel. |
tech_user_id | integer | An ID of the user, which is responsible for the technical matters. |
bill_user_id | integer | An ID of the user, which is responsible for the financial matters. |
custom_attributes | array | A list of additional attributes (see Managing attributes in the ActivePlatform. Operator Control Panel):
|
created_at | date | A date and time of the account's creation. |
updated_at | date | A date and time, when the account information was updated. |
Request example
http://billing.activeplatform.com:80/api/vendor/v1/accounts/2000589.json?api_token=654321
{
"manager_id": null,
"account_type_id": 1,
"first_name": "John",
"last_name": "Doe",
"owner_id": 2002990,
"account_class_id": 1,
"country": "BY",
"region": "Minsk",
"city": "Minsk",
"street": "Lenina",
"building": "1",
"office": "1",
"zip": "220007",
"phone": "+375290745930",
"email": "doe.john@activeplatform.com"
}
Response example
{
"id": 2000589,
"name": "John Doe",
"account_class_id": 1,
"account_class": "Default",
"primary_name": "",
"first_name": "John",
"middle_name": null,
"last_name": "Doe",
"country": "BY",
"region": "Minsk",
"city": "Minsk",
"street": "Lenina",
"building": "1",
"office": "1",
"zip": "220007",
"phone": "+375290745930",
"email": "doe.john@activeplatform.com",
"status": "active",
"balance": 0,
"credit_limit": 1,
"account_type_id": 1,
"account_type": "Personal",
"manager_id": null,
"owner_id": 2002990,
"tech_user_id": 2002990,
"bill_user_id": 2002990,
"custom_attributes": [
{
"name": "Oasis Account ID",
"value": ""
},
{
"name": "Trial",
"value": ""
},
{
"name": "Passport issued by",
"value": "Goverment"
},
{
"name": "Passport number",
"value": "112111111111"
},
{
"name": "Birth date",
"value": "10.08.2016"
},
{
"name": "Personal number",
"value": "11111111"
},
{
"name": "Passport date of issue",
"value": "01.07.2016"
}
],
"created_at": "2016-10-04T03:45:11.720+03:00",
"updated_at": "2016-10-04T05:03:47.181+03:00"
}