Deposit
Adds funds to shared accounts using an advertising agency's credit limit, or the advertiser's overdraft.
This action allows advertising agencies and direct advertisers to add funds to the account balance with deferred payment (see the section Paying by credit and overdraft).
Recommendations and restrictions
A direct advertiser can add funds to the shared account only if there is at least one campaign that has passed moderation.
We recommend adding funds to shared accounts using the fewest possible AccountManagement.Deposit
operations per day. This recommendation is aimed at improving the performance of the Yandex Direct API. From the point of view of productivity, it is better to make deposits to several accounts in a single operation than to use multiple operations to make each deposit separately.
Input data
The input data structure in JSON is shown below.
Alert
It is mandatory to include the finance_token
and operation_num
parameters in the request. For information on generating the token, see the section Working with the shared account.
{
"method": "AccountManagement",
"finance_token": (string),
"operation_num": (int),
"param": {
/* AccountManagementRequest */
"Action": (string),
"Payments": [
{ /* Payment */
"AccountID": (int),
"Amount": (float),
"Origin": (string),
"Contract": (string),
"Currency": (string)
}
...
]
}
}
Parameters are described below.
Parameter |
Description |
Required |
AccountManagementRequest object |
||
|
Action: Deposit. |
Yes |
|
Array of |
Yes |
Payment object |
||
|
ID of the shared account to add funds to. |
Yes |
|
The deposit amount in the currency specified in the The specified amount is mathematically rounded to the second decimal place (for all currencies, including the tenge). To get the minimum acceptable value, use the Dictionaries.get method for version 5 of the API and specify the dictionary name |
Yes |
|
Deposit method: Overdraft. |
For payment using overdraft |
|
The number of the credit agreement. |
For payment using credit |
|
The currency that the amount is shown in. Acceptable values: RUB, CHF, EUR, KZT, TRY, UAH, USD, BYN. The value must match the currency of the shared account; otherwise, an error is returned with code 245. |
Yes |
Output data
Alert
An error when depositing funds to one of the accounts does not cause the entire operation to be canceled, and does not affect the success of depositing funds to the other 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.
Parameter |
Description |
AccountManagementResponse object |
|
|
Array of
The items in the array are in the same order as the objects in the |
AccountActionResult object |
|
|
ID of the shared account. |
|
Array of |
Error object |
|
|
Error code. |
|
Textual message about the error. |
|
Detailed description of the reason for the error. |
Examples of input data
Python
{
'Action': 'Deposit',
'Payments': [
{
'AccountID': 3193244,
'Amount': 5000.0,
'Origin': 'Overdraft',
'Currency': 'RUB'
},
{
'AccountID': 3193279,
'Amount': 1200.0,
'Contract': '23452345/67',
'Currency': 'USD'
}
]
}
PHP
array(
'Action' ='Deposit',
'Payments' =array(
array(
'AccountID' =3193244,
'Amount' =5000.0,
'Origin' ='Overdraft',
'Currency' ='RUB'
),
array(
'AccountID' =3193279,
'Amount' =1200.0,
'Contract' ='23452345/67',
'Currency' ='USD'
)
)
)
Perl
{
'Action' ='Deposit',
'Payments' =[
{
'AccountID' =3193244,
'Amount' =5000.0,
'Contract' ='Overdraft',
'Currency' ='RUB'
},
{
'AccountID' =3193279,
'Amount' =1200.0,
'Contract' ='23452345/67',
'Currency' ='RUB'
}
]
}