update_billing_code

To assign a new activation code to a unit or unassign an old one, use the unit/update_billing_code method.

Endpoint

Copied!
svc=unit/update_billing_code&params={
  "itemId": <long>,
  "code": <text>
}

Parameters

The request must contain the following parameters:

Parameter Description
itemId Unit ID.
code Activation code to be assigned or unassigned.

Example

Below is an example of the unit/update_billing_code request.

Copied!
svc=unit/update_billing_code&params={
  "itemId": 1133,
  "code": "bf6364e80170cbd4a42bfa8eb446deff"
}

Response

If the request is completed successfully, the response is returned in the following format:

Copied!
{
  "code": <text>   /* Activation code. */
}

If the request fails, an error code is returned.

Error codes

Error code Description
6 Failed to assign or unassign the code. The reason field contains one of the following values:
  • ITEM_CODE_NOT_EXIST: the code isn’t found;
  • ITEM_CODE_NOT_UNIQUE: the code is already assigned to a unit;
  • CODE_INTERNAL_ERROR: internal error.
7 Access denied. This happens in one of the following cases:
  • the activation code feature isn’t enabled for the service. In this case, the reason field contains Access denied;
  • the unit doesn’t exist, or the user has no Manage activation codes access right to it.

If you find a mistake in the text, please select it and press Ctrl+Enter.