> ## Documentation Index
> Fetch the complete documentation index at: https://adyen-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Return Transferred Funds

> Return funds to the sender of the original internal transfer, without creating a new transfer.

If funds were transferred from one balance account to another by mistake, you can return the funds to the source balance account without initiating a new internal transfer. Instead, you provide the transfer ID of the original incoming transfer. Returning the funds is then handled as a modification of that same internal transfer.

Note that returning funds in this way only works if the original internal transfer was a push transfer.

## Requirements

* Make sure that your server can [receive and accept webhooks](https://adyen-preview.mintlify.site/development-resources/webhooks/configure-and-manage.md), and that the **Transfer webhook** has been added in your [Customer Area](https://ca-test.adyen.com/).

* Ask our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to enable transfers for the balance account where the funds are returned from.

* If the balance accounts involved in the internal funds transfer *do not belong to the same account holder*, check the [capabilities](https://adyen-preview.mintlify.site/marketplaces/verification-overview/capabilities.md#capabilities) of the account holders:

  * The account holder of the balance account where the funds are returned from must have the **sendToBalanceAccount** capability.
  * The account holder of the balance account where the funds are returned to must have the **receiveFromBalanceAccount** capability.

* Make sure that your [API credential](https://adyen-preview.mintlify.site/marketplaces/manage-access/api-credentials-web-service.md):

  * Has access to the [Transfers API](https://docs.adyen.com/api-explorer/transfers/latest/overview).
  * Has the **TransferService Webservice Initiate [role](https://adyen-preview.mintlify.site/marketplaces/manage-access/webservice-roles.md)**.

## Initiate a return

To return an internal push transfer:

1. Make a POST [/transfers/\{transferId}/returns](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers/\(transferId\)/returns) request, where `{transferId}` is the ID of the original incoming transfer that is returned in the webhooks.

   Specify the following request parameters:

   | Parameter | Required | Description |
   | - | - | - |
   | [amount](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers/\(transferId\)/returns#request-amount) | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Object containing the currency and value of the transfer. These must be the same as in the original transfer. |
   | [reference](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers/\(transferId\)/returns#request-reference) | | Your unique reference for returning the transfer. |

   The following example shows how to return EUR 100 previously received through an internal transfer with the ID `123XYZABC456DEF7`.

   **Return an internal transfer**

   #### curl

   ```bash theme={null}
   curl https://balanceplatform-api-test.adyen.com/btl/v4/transfers/123XYZABC456DEF7/returns \
   -H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \
   -H 'content-type: application/json' \
   -X POST \
   -d '{
      "amount": {
         "currency": "EUR",
         "value": 10000
      },
      "reference": "YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN"
   }'
   ```

   #### Java

   ```java theme={null}
   // Adyen Java API Library v33.0.0
   import com.adyen.Client;
   import com.adyen.enums.Environment;
   import com.adyen.model.transfers.*;
   import java.time.OffsetDateTime;
   import java.util.*;
   import com.adyen.model.RequestOptions;
   import com.adyen.service.transfers.*;

   Client client = new Client("ADYEN_BALANCE_PLATFORM_API_KEY", Environment.TEST);

   // Create the request object(s)
   Amount amount = new Amount()
     .currency("EUR")
     .value(10000L);

   ReturnTransferRequest returnTransferRequest = new ReturnTransferRequest()
     .reference("YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN")
     .amount(amount);

   // Send the request
   TransfersApi service = new TransfersApi(client);
   ReturnTransferResponse response = service.returnTransfer("transferId", returnTransferRequest, new RequestOptions().idempotencyKey("UUID"));
   ```

   #### PHP

   ```php theme={null}
   <?php
   // Adyen PHP API Library v24.0.0
   use Adyen\Client;
   use Adyen\Environment;
   use Adyen\Model\Transfers\Amount;
   use Adyen\Model\Transfers\ReturnTransferRequest;
   use Adyen\Service\Transfers\TransfersApi;

   $client = new Client();
   $client->setXApiKey("ADYEN_BALANCE_PLATFORM_API_KEY");
   $client->setEnvironment(Environment::TEST);


   // Create the request object(s)
   $amount = new Amount();
   $amount
     ->setCurrency("EUR")
     ->setValue(10000);

   $returnTransferRequest = new ReturnTransferRequest();
   $returnTransferRequest
     ->setReference("YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN")
     ->setAmount($amount);

   $requestOptions['idempotencyKey'] = 'UUID';

   // Send the request
   $service = new TransfersApi($client);
   $response = $service->returnTransfer('transferId', $returnTransferRequest, $requestOptions);
   ```

   #### C\#

   ```cs theme={null}
   // Adyen .net API Library v28.0.0
   using Adyen;
   using Environment = Adyen.Model.Environment;
   using Adyen.Model;
   using Adyen.Model.Transfers;
   using Adyen.Service.Transfers;

   var config = new Config()
   {
       XApiKey = "ADYEN_BALANCE_PLATFORM_API_KEY",
       Environment = Environment.Test
   };
   var client = new Client(config);

   // Create the request object(s)
   Amount amount = new Amount
   {
     Currency = "EUR",
     Value = 10000
   };

   ReturnTransferRequest returnTransferRequest = new ReturnTransferRequest
   {
     Reference = "YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN",
     Amount = amount
   };

   // Send the request
   var service = new TransfersService(client);
   var response = service.ReturnTransfer("transferId", returnTransferRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
   ```

   #### NodeJS (JavaScript)

   ```js theme={null}
   // Adyen Node API Library v23.3.0
   const { Client, TransfersAPI } = require('@adyen/api-library');

   const client = new Client({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: "TEST" });

   // Create the request object(s)
   const returnTransferRequest = {
     amount: {
       currency: "EUR",
       value: 10000
     },
     reference: "YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN"
   }

   // Send the request
   const transfersAPI = new TransfersAPI(client);
   const response = transfersAPI.TransfersApi.returnTransfer("transferId", returnTransferRequest, { idempotencyKey: "UUID" });
   ```

   #### Go

   ```go theme={null}
   // Adyen Go API Library v17.0.0
   import (
     "context"
     "github.com/adyen/adyen-go-api-library/v17/src/common"
     "github.com/adyen/adyen-go-api-library/v17/src/adyen"
     "github.com/adyen/adyen-go-api-library/v17/src/transfers"
   )
   client := adyen.NewClient(&common.Config{
     ApiKey:      "ADYEN_BALANCE_PLATFORM_API_KEY",
     Environment: common.TestEnv,
   })

   // Create the request object(s)
   amount := transfers.Amount{
     Currency: "EUR",
     Value: 10000,
   }

   returnTransferRequest := transfers.ReturnTransferRequest{
     Reference: common.PtrString("YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN"),
     Amount: amount,
   }

   // Send the request
   service := client.Transfers()
   req := service.TransfersApi.ReturnTransferInput("transferId").IdempotencyKey("UUID").ReturnTransferRequest(returnTransferRequest)
   res, httpRes, err := service.TransfersApi.ReturnTransfer(context.Background(), req)
   ```

   #### Python

   ```py theme={null}
   # Adyen Python API Library v13.3.0
   import Adyen

   adyen = Adyen.Adyen()
   adyen.client.xapikey = "ADYEN_BALANCE_PLATFORM_API_KEY"
   adyen.client.platform = "test" # The environment to use library in.

   # Create the request object(s)
   json_request = {
     "amount": {
       "currency": "EUR",
       "value": 10000
     },
     "reference": "YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN"
   }

   # Send the request
   result = adyen.transfers.transfers_api.return_transfer(request=json_request, transferId="transferId", idempotency_key="UUID")
   ```

   #### Ruby

   ```rb theme={null}
   # Adyen Ruby API Library v10.1.1
   require "adyen-ruby-api-library"

   adyen = Adyen::Client.new
   adyen.api_key = 'ADYEN_BALANCE_PLATFORM_API_KEY'
   adyen.env = :test # Set to "live" for live environment

   # Create the request object(s)
   request_body = {
     :amount => {
       :currency => 'EUR',
       :value => 10000
     },
     :reference => 'YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN'
   }

   # Send the request
   result = adyen.transfers.transfers_api.return_transfer(request_body, 'transferId', headers: { 'Idempotency-Key' => 'UUID' })
   ```

   #### NodeJS (TypeScript)

   ```ts theme={null}
   // Adyen Node API Library v23.3.0
   import { Client, TransfersAPI, Types } from "@adyen/api-library";

   const client = new Client({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: "TEST" });

   // Create the request object(s)
   const amount: Types.transfers.Amount = {
     currency: "EUR",
     value: 10000
   };

   const returnTransferRequest: Types.transfers.ReturnTransferRequest = {
     reference: "YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN",
     amount: amount
   };

   // Send the request
   const transfersAPI = new TransfersAPI(client);
   const response = transfersAPI.TransfersApi.returnTransfer("transferId", returnTransferRequest, { idempotencyKey: "UUID" });
   ```

2. In the response, note the following:

   * `id`: the ID of the return request.
   * `status`: **Authorised**. If **Declined**, this can indicate that you used the wrong transfer ID in the URL.
   * `transferId`: the ID of the original incoming transfer, which you specified in the URL of the return request.

   **Response**

   ```json theme={null}
   {
      "id": "4LR2TG600M43TYM5",
      "reference": "YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN",
      "status": "authorised",
      "transferId": "123XYZABC456DEF7"
   }
   ```

## Get updates on the status of the return

Track returns by using the [webhooks](https://adyen-preview.mintlify.site/marketplaces/internal-fund-transfers/internal-transfer-webhooks.md) that Adyen sends to your server. The webhooks provide the status of the request and also inform you if the request failed.

You can also [view the return in your Customer Area](https://adyen-preview.mintlify.site/marketplaces/view-transfers-details.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.