Update

Changes settings for shared accounts.

Restrictions

The daily budget settings can be changed a maximum of 3 times a day.

Input data

The input data structure in JSON is shown below.

Attention. Values of omitted parameters are not changed.
{
   "method": "AccountManagement",
   "param": {
      /* AccountManagementRequest */
      "Action": (string),
      "Accounts": [
         {  /* Account */
            "AccountID": (int),
            "AccountDayBudget": {
               /* AccountDayBudgetInfo */
               "Amount": (float), 
               "SpendMode": (string)
            },
            "SmsNotification": {
               /* SmsNotificationInfo */
               "MoneyInSms": (string),
               "MoneyOutSms": (string),
               "PausedByDayBudgetSms": (string),
               "SmsTimeFrom": (string),
               "SmsTimeTo": (string)
            },
            "EmailNotification": {
               /* EmailNotificationInfo */
               "Email": (string),
               "MoneyWarningValue": (int),
               "PausedByDayBudget": (string)
            }
         }
         ...
      ]
   }
}

Parameters are described below.

ParameterDescriptionRequired
AccountManagementRequest object
ActionAction: Update.Yes
AccountsArray of Account objects. Each object contains information about settings for a shared account.No
Account object
AccountIDID of the shared account to change settings for.Yes
AccountDayBudget

The AccountDayBudgetInfo object with parameters for the daily limit on the shared account.

No
SmsNotification

The SmsNotificationInfo object with parameters for sending SMS notifications.

To get notifications, you must subscribe to them (see the Help section Subscribe to SMS notifications). The phone number to send notifications to is taken from the user data (see the Help section Mobile numbers).

No
EmailNotification

The EmailNotificationInfo object with parameters for sending notifications by email.

No
AccountDayBudgetInfo object
Amount

The daily budget for the shared account (in the shared account currency).

To get the minimum acceptable value, use the Dictionaries.get method for version 5 of the API and specify the dictionary name Currencies in the request.

A value of 0 nullifies the daily budget.

Yes
SpendMode

Mode for displaying ads:

  • Default — Standard mode.

  • Stretched — Distributed mode.

See Daily budget under “Shared account” in the Help for Yandex.Direct.

The mode applies to all campaigns, and the corresponding setting on the campaign level is ignored.

Yes
SmsNotificationInfo object
MoneyInSmsNotify when funds are credited to the shared account — Yes/No. The predefined value is No.No
MoneyOutSmsNotify when funds are debited from the shared account — Yes/No. The predefined value is No.No
PausedByDayBudgetSmsNotify when campaigns are stopped because of reaching the daily limit on the shared account— Yes/No. The predefined value is Yes.No
SmsTimeFromThe allowed starting time for sending SMS notifications related to the shared account. Specified in the format HH:MM; minutes are set in multiples of 15 (0, 15, 30, 45). For example, “19:45”.No
SmsTimeToThe ending time for sending SMS notifications related to the shared account. Specified in the format HH:MM; minutes are set in multiples of 15 (0, 15, 30, 45). For example, “19:45”.No
EmailNotificationInfo object
EmailThe email address for sending notifications of events related to the shared account.No
MoneyWarningValueThe minimal balance; notification is sent when the account balance is reduced to this amount. Set as a percentage of the amount of the last payment. The predefined value is 20.No
PausedByDayBudgetNotify when campaigns are stopped because of reaching the daily limit on the shared account— Yes/No. The predefined value is Yes.No

Output data

Attention. An error when changing settings for one of the shared accounts does not cause the entire operation to be canceled, and does not affect the success of changing settings for the other shared accounts.

The output data structure in JSON is shown below.

{
   "data": {
      /* AccountManagementResponse */
      "ActionsResult": [
         {  /* AccountActionResult */
            "AccountID": (int),            
            "Errors": [
               {  /* Error */
                  "FaultCode": (int),
                  "FaultString": (string),
                  "FaultDetail": (string)
               }
               ...
            ]
         }
         ...
      ]
   }
}

Parameters are described below.

ParameterDescription
AccountManagementResponse object
ActionsResult

Array of AccountActionResult objects Each object corresponds to an item in the Accounts input array and contains:

  • The ID of the shared account, if the settings were changed successfully.
  • The Errors array, if an error occurred.

The items in the array are in the same order as the objects in the Accounts input array.

AccountActionResult object
AccountIDID of the shared account that settings were successfully changed for.
ErrorsArray of Error objects with errors that occurred while transferring funds.
Error object
FaultCodeError code.
FaultStringTextual message about the error.
FaultDetailDetailed description of the reason for the error.

Examples of input data

Python

{
   'Action': 'Update',
   'Accounts': [
      {
         'AccountID': 1327944,
         'SmsNotification': {
            'MoneyInSms': 'Yes',
            'MoneyOutSms': 'Yes'
         },
         'EmailNotification': {
            'Email': 'agrom@yandex.ru',
            'MoneyWarningValue': 25
         }
      }
   ]
}

PHP

array(
   'Action' => 'Update',
   'Accounts' => array(
      array(
         'AccountID' => 1327944,
         'SmsNotification' => array(
            'MoneyInSms' => 'Yes',
            'MoneyOutSms' => 'Yes'
         ),
         'EmailNotification' => array(
            'Email' => 'agrom@yandex.ru',
            'MoneyWarningValue' => 25
         )
      )
   )
)

Perl

{
   'Action' => 'Update',
   'Accounts' => [
      {
         'AccountID' => 1327944,
         'SmsNotification' => {
            'MoneyInSms' => 'Yes',
            'MoneyOutSms' => 'Yes'
         },
         'EmailNotification' => {
            'Email' => 'agrom@yandex.ru',
            'MoneyWarningValue' => 25
         }
      }
   ]
}