---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.2
alternate:
  - https://yandex.com/dev/direct/doc/dg-v4/en/reference/TransferMoney.md
  - https://yandex.com/dev/direct/doc/dg-v4/ru/reference/TransferMoney.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/direct/doc/dg-v4/en/llms.txt

# TransferMoney
Transfers funds between campaigns.

{% note alert %}

Disabled method. Use version 5 of the API.

For information about the compatibility of methods between versions 4 and 5, see the [Migration guide](https://yandex.com/dev/direct/doc/migration/concepts/methods.md).

{% endnote %}


The [TransferMoney (Live)](https://yandex.com/dev/direct/doc/dg-v4/en/live/TransferMoney.md) version also exists for this method.

When calling this method, specify one or more campaigns to deduct funds from, and one or more campaigns to transfer funds to. The total sum of deducted funds and the total sum of credited funds must be the same. If the totals don't match, error [353](https://yandex.com/dev/direct/doc/dg-v4/en/reference/ErrorCodes.md#errorCode353) occurs.

There is a slight delay before transferring funds, usually no more than five minutes.

## Restrictions

Restrictions on method calls:

- A single user can call the method 1000 times per day.
- A single campaign can have funds added to it no more than 30 times per day. This restriction does not apply to deducting funds.
    

Exceeding these limits results in the error [56](https://yandex.com/dev/direct/doc/dg-v4/en/reference/ErrorCodes.md#ErrorCode56).

When using this method, the same financial restrictions apply as when transferring funds in the Yandex Direct interface (see the section [Transferring funds between campaigns](https://yandex.ru/support/direct/payments/operations.xml)[Transferring funds between campaigns](https://yandex.com/support/direct-tooltips/transferring.xml)).

One of the restrictions is that you are not allowed to transfer out funds that came from certain Yandex marketing programs, such as coupons or discounts. In such cases, the amount being deducted is automatically reduced to the amount that is allowed to be transferred out of the campaign, and this smaller amount is credited to the other campaign. If several campaigns are specified for crediting funds to, the amount they receive is decreased such that the credited amounts maintain the same proportion as the amounts that were originally specified.


## Input data {#input}

The input data structure in JSON is shown below.


{% note alert %}

It is mandatory to include the `finance_token` and `operation_num` parameters in the request. For more information, see the [Accessing finance methods](https://yandex.com/dev/direct/doc/dg-v4/en/concepts/finance-token.md).

{% endnote %}


```javascript
{
   "method": "TransferMoney",
   "finance_token": (string),
   "operation_num": (int),
   "param": {
      /* TransferMoneyInfo */
      "FromCampaigns": [
         {  /* PayCampElement */
            "CampaignID": (int),
            "Sum": (float)
         }
         ...
      ],
      "ToCampaigns": [
         {  /* PayCampElement */
            "CampaignID": (int),
            "Sum": (float)
         }
         ...
      ]
   }
}
```

Parameters are described below.


#|
||
**<sup >Parameter</sup>**
|
**<sup >Description</sup>**
|
**<sup >Required</sup>**
||

||
**<sub >TransferMoneyInfo object</sub>**
||
||
`FromCampaigns`
|
Array of `PayCampElement` objects. Each object specifies the campaign to deduct funds from, and the amount to deduct.
|
Yes
||
||
`ToCampaigns`
|
Array of `PayCampElement` objects. Each object specifies the campaign to add funds to, and the amount to credit.
|
Yes
||

||
**<sub >PayCampElement object</sub>**
||
||
`CampaignID`
|
The campaign ID.
|
Yes
||
||
`Sum`
|
The amount in Yandex units that is being deducted from or credited to a campaign (depending on whether the object is part of the `FromCampaigns` array or the `ToCampaigns` array).

To find out the amount available to transfer, use the [GetCampaignsParams](https://yandex.com/dev/direct/doc/dg-v4/en/reference/GetCampaignsParams.md) method (SumAvailableForTransfer parameter).
|
Yes
||
|#


## Output data {#output}

Returns the value 1 when funds were transfered successfully, as shown below. If unsuccessful, an error message is returned.

```javascript
{ "data": 1 }
```


## Examples of input data {#examples}

## Python

```python
{
   'FromCampaigns': [
      {'CampaignID': 1327837, 'Sum': 2500}
   ],
   'ToCampaigns': [
      {'CampaignID': 1327944, 'Sum': 2000},
      {'CampaignID': 1327953, 'Sum': 500}
   ]
}
```

## PHP

```php
array(
   'FromCampaigns' => array(
      array('CampaignID' => 1327837, 'Sum' =2500)
   ),
   'ToCampaigns' => array(
      array('CampaignID' => 1327944, 'Sum' => 2000),
      array('CampaignID' => 1327953, 'Sum' =500)
   )
)
```

## Perl

```perl
{
   'FromCampaigns' => [
      {'CampaignID' => 1327837, 'Sum' =2500}
   ],
   'ToCampaigns' => [
      {'CampaignID' => 1327944, 'Sum' => 2000},
      {'CampaignID' => 1327953, 'Sum' =500}
   ]
}
```


