{"title":"Return transferred funds","category":"default","creationDate":1692739920,"content":"<p>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.<\/p>\n<p>Note that returning funds in this way only works if the original internal transfer was a push transfer.<\/p>\n<h2>Requirements<\/h2>\n<ul>\n<li>Make sure that your server can <a href=\"\/pt\/development-resources\/webhooks\/configure-and-manage\">receive and accept webhooks<\/a>, and that the <strong>Transfer webhook<\/strong> has been added in your <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>.<\/li>\n<li>Ask our <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a> to enable transfers for the balance account where the funds are returned from.<\/li>\n<li>If the balance accounts involved in the internal funds transfer <em>do not belong to the same account holder<\/em>, check the capabilities of the account holders:\n<ul>\n<li>The account holder of the balance account where the funds are returned from must have the <strong>sendToBalanceAccount<\/strong> capability.<\/li>\n<li>The account holder of the balance account where the funds are returned to must have the <strong>receiveFromBalanceAccount<\/strong> capability.<\/li>\n<\/ul><\/li>\n<li>Make sure that your <a href=\"\/pt\/payouts\/payout-service\/manage-access\/api-credentials-web-service\/\">API credential<\/a>:\n<ul>\n<li>Has access to the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/transfers\/latest\/overview\" class=\" external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Transfers API<\/a>.<\/li>\n<li>Has the <strong>TransferService Webservice Initiate <a href=\"\/pt\/payouts\/payout-service\/manage-access\/webservice-roles\/?tab=transfers_3\">role<\/a><\/strong>.<\/li>\n<\/ul><\/li>\n<\/ul>\n<h2>Initiate a return<\/h2>\n<p>To return an internal push transfer:<\/p>\n<ol>\n<li>\n<p>Make a POST  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/transfers\/latest\/post\/transfers\/(transferId)\/returns\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/transfers\/{transferId}\/returns<\/a> request, where <code>{transferId}<\/code> is the ID of the original incoming transfer that is returned in the webhooks.<\/p>\n<p>Specify the following request parameters:<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Required<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/transfers\/latest\/post\/transfers\/(transferId)\/returns#request-amount\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount<\/a><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>Object containing the currency and value of the transfer. These must be the same as in the original transfer.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/transfers\/latest\/post\/transfers\/(transferId)\/returns#request-reference\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">reference<\/a><\/td>\n<td><\/td>\n<td>Your unique reference for returning the transfer.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The following example shows how to return EUR 100 previously received through an internal transfer with the ID <code>123XYZABC456DEF7<\/code>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Return an internal transfer'\" :id=\"'return-fund-transfer'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/balanceplatform-api-test.adyen.com\\\/btl\\\/v4\\\/transfers\\\/123XYZABC456DEF7\\\/returns \\\\\\n-H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X POST \\\\\\n-d '{\\n   \\&quot;amount\\&quot;: {\\n      \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;,\\n      \\&quot;value\\&quot;: 10000\\n   },\\n   \\&quot;reference\\&quot;: \\&quot;YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN\\&quot;\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v33.0.0\\nimport com.adyen.Client;\\nimport com.adyen.enums.Environment;\\nimport com.adyen.model.transfers.*;\\nimport java.time.OffsetDateTime;\\nimport java.util.*;\\nimport com.adyen.model.RequestOptions;\\nimport com.adyen.service.transfers.*;\\n\\nClient client = new Client(\\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;, Environment.TEST);\\n\\n\\\/\\\/ Create the request object(s)\\nAmount amount = new Amount()\\n  .currency(\\&quot;EUR\\&quot;)\\n  .value(10000L);\\n\\nReturnTransferRequest returnTransferRequest = new ReturnTransferRequest()\\n  .reference(\\&quot;YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN\\&quot;)\\n  .amount(amount);\\n\\n\\\/\\\/ Send the request\\nTransfersApi service = new TransfersApi(client);\\nReturnTransferResponse response = service.returnTransfer(\\&quot;transferId\\&quot;, returnTransferRequest, new RequestOptions().idempotencyKey(\\&quot;UUID\\&quot;));&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;&lt;?php\\n\\\/\\\/ Adyen PHP API Library v24.0.0\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Model\\\\Transfers\\\\Amount;\\nuse Adyen\\\\Model\\\\Transfers\\\\ReturnTransferRequest;\\nuse Adyen\\\\Service\\\\Transfers\\\\TransfersApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;);\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\n\\\/\\\/ Create the request object(s)\\n$amount = new Amount();\\n$amount\\n  -&gt;setCurrency(\\&quot;EUR\\&quot;)\\n  -&gt;setValue(10000);\\n\\n$returnTransferRequest = new ReturnTransferRequest();\\n$returnTransferRequest\\n  -&gt;setReference(\\&quot;YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN\\&quot;)\\n  -&gt;setAmount($amount);\\n\\n$requestOptions['idempotencyKey'] = 'UUID';\\n\\n\\\/\\\/ Send the request\\n$service = new TransfersApi($client);\\n$response = $service-&gt;returnTransfer('transferId', $returnTransferRequest, $requestOptions);&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen .net API Library v28.0.0\\nusing Adyen;\\nusing Environment = Adyen.Model.Environment;\\nusing Adyen.Model;\\nusing Adyen.Model.Transfers;\\nusing Adyen.Service.Transfers;\\n\\nvar config = new Config()\\n{\\n    XApiKey = \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n    Environment = Environment.Test\\n};\\nvar client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\nAmount amount = new Amount\\n{\\n  Currency = \\&quot;EUR\\&quot;,\\n  Value = 10000\\n};\\n\\nReturnTransferRequest returnTransferRequest = new ReturnTransferRequest\\n{\\n  Reference = \\&quot;YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN\\&quot;,\\n  Amount = amount\\n};\\n\\n\\\/\\\/ Send the request\\nvar service = new TransfersService(client);\\nvar response = service.ReturnTransfer(\\&quot;transferId\\&quot;, returnTransferRequest, requestOptions: new RequestOptions { IdempotencyKey = \\&quot;UUID\\&quot;});&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v23.3.0\\nconst { Client, TransfersAPI } = require('@adyen\\\/api-library');\\n\\nconst client = new Client({ apiKey: \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot; });\\n\\n\\\/\\\/ Create the request object(s)\\nconst returnTransferRequest = {\\n  amount: {\\n    currency: \\&quot;EUR\\&quot;,\\n    value: 10000\\n  },\\n  reference: \\&quot;YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN\\&quot;\\n}\\n\\n\\\/\\\/ Send the request\\nconst transfersAPI = new TransfersAPI(client);\\nconst response = transfersAPI.TransfersApi.returnTransfer(\\&quot;transferId\\&quot;, returnTransferRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;},{&quot;language&quot;:&quot;go&quot;,&quot;tabTitle&quot;:&quot;Go&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Go API Library v17.0.0\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v17\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v17\\\/src\\\/adyen\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v17\\\/src\\\/transfers\\&quot;\\n)\\nclient := adyen.NewClient(&amp;common.Config{\\n  ApiKey:      \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n  Environment: common.TestEnv,\\n})\\n\\n\\\/\\\/ Create the request object(s)\\namount := transfers.Amount{\\n  Currency: \\&quot;EUR\\&quot;,\\n  Value: 10000,\\n}\\n\\nreturnTransferRequest := transfers.ReturnTransferRequest{\\n  Reference: common.PtrString(\\&quot;YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN\\&quot;),\\n  Amount: amount,\\n}\\n\\n\\\/\\\/ Send the request\\nservice := client.Transfers()\\nreq := service.TransfersApi.ReturnTransferInput(\\&quot;transferId\\&quot;).IdempotencyKey(\\&quot;UUID\\&quot;).ReturnTransferRequest(returnTransferRequest)\\nres, httpRes, err := service.TransfersApi.ReturnTransfer(context.Background(), req)&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v13.3.0\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\n# Create the request object(s)\\njson_request = {\\n  \\&quot;amount\\&quot;: {\\n    \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;,\\n    \\&quot;value\\&quot;: 10000\\n  },\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN\\&quot;\\n}\\n\\n# Send the request\\nresult = adyen.transfers.transfers_api.return_transfer(request=json_request, transferId=\\&quot;transferId\\&quot;, idempotency_key=\\&quot;UUID\\&quot;)&quot;},{&quot;language&quot;:&quot;rb&quot;,&quot;tabTitle&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;# Adyen Ruby API Library v10.1.1\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_BALANCE_PLATFORM_API_KEY'\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Create the request object(s)\\nrequest_body = {\\n  :amount =&gt; {\\n    :currency =&gt; 'EUR',\\n    :value =&gt; 10000\\n  },\\n  :reference =&gt; 'YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN'\\n}\\n\\n# Send the request\\nresult = adyen.transfers.transfers_api.return_transfer(request_body, 'transferId', headers: { 'Idempotency-Key' =&gt; 'UUID' })&quot;},{&quot;language&quot;:&quot;ts&quot;,&quot;tabTitle&quot;:&quot;NodeJS (TypeScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v23.3.0\\nimport { Client, TransfersAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\nconst client = new Client({ apiKey: \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot; });\\n\\n\\\/\\\/ Create the request object(s)\\nconst amount: Types.transfers.Amount = {\\n  currency: \\&quot;EUR\\&quot;,\\n  value: 10000\\n};\\n\\nconst returnTransferRequest: Types.transfers.ReturnTransferRequest = {\\n  reference: \\&quot;YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN\\&quot;,\\n  amount: amount\\n};\\n\\n\\\/\\\/ Send the request\\nconst transfersAPI = new TransfersAPI(client);\\nconst response = transfersAPI.TransfersApi.returnTransfer(\\&quot;transferId\\&quot;, returnTransferRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>In the response, note the following:<\/p>\n<ul>\n<li><code>id<\/code>: the ID of the return request.<\/li>\n<li><code>status<\/code>: <strong>Authorised<\/strong>. If <strong>Declined<\/strong>, this can indicate that you used the wrong transfer ID in the URL.<\/li>\n<li><code>transferId<\/code>: the ID of the original incoming transfer, which you specified in the URL of the return request.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"id\\\": \\\"4LR2TG600M43TYM5\\\",\\n   \\\"reference\\\": \\\"YOUR_UNIQUE_REFERENCE_FOR_THE_RETURN\\\",\\n   \\\"status\\\": \\\"authorised\\\",\\n   \\\"transferId\\\": \\\"123XYZABC456DEF7\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<h2>Get updates on the status of the return<\/h2>\n<p>Track returns by using the <a href=\"\/pt\/payouts\/payout-service\/internal-fund-transfers\/internal-transfer-webhooks\">webhooks<\/a> that Adyen sends to your server. The webhooks provide the status of the request and also inform you if the request failed.<\/p>\n<p>You can also <a href=\"\/pt\/payouts\/payout-service\/view-transfers-details\">view the return in your Customer Area<\/a>.<\/p>","url":"https:\/\/docs.adyen.com\/pt\/payouts\/payout-service\/internal-fund-transfers\/return-transfers","articleFields":{"description":"Return funds to the sender of the original internal transfer, without creating a new transfer.","last_edit_on":"11-09-2020 17:20","cache_enable":false,"parameters":{"directoryPath":"\/payouts\/payout-service","model":"platform","integrationType":"payouts"},"page_id":"f98f4d18-fe1a-43cf-b526-e9d22576ac52","feedback_component":true,"filters_component":false,"decision_tree":"[]"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payouts\/payout-service\/internal-fund-transfers\/return-transfers","title":"Return transferred funds","content":"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.\nNote that returning funds in this way only works if the original internal transfer was a push transfer.\nRequirements\n\nMake sure that your server can receive and accept webhooks, and that the Transfer webhook has been added in your Customer Area.\nAsk our Support Team to enable transfers for the balance account where the funds are returned from.\nIf the balance accounts involved in the internal funds transfer do not belong to the same account holder, check the capabilities of the account holders:\n\nThe account holder of the balance account where the funds are returned from must have the sendToBalanceAccount capability.\nThe account holder of the balance account where the funds are returned to must have the receiveFromBalanceAccount capability.\n\nMake sure that your API credential:\n\nHas access to the  Transfers API.\nHas the TransferService Webservice Initiate role.\n\n\nInitiate a return\nTo return an internal push transfer:\n\n\nMake a POST  \/transfers\/{transferId}\/returns request, where {transferId} is the ID of the original incoming transfer that is returned in the webhooks.\nSpecify the following request parameters:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\n amount\n\nObject containing the currency and value of the transfer. These must be the same as in the original transfer.\n\n\n reference\n\nYour unique reference for returning the transfer.\n\n\n\nThe following example shows how to return EUR 100 previously received through an internal transfer with the ID 123XYZABC456DEF7.\n\n\n\n\n\nIn the response, note the following:\n\nid: the ID of the return request.\nstatus: Authorised. If Declined, this can indicate that you used the wrong transfer ID in the URL.\ntransferId: the ID of the original incoming transfer, which you specified in the URL of the return request.\n\n\n\n\n\n\nGet updates on the status of the return\nTrack returns by using the webhooks that Adyen sends to your server. The webhooks provide the status of the request and also inform you if the request failed.\nYou can also view the return in your Customer Area.","type":"page","locale":"pt","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Adyen Payouts","lvl2":"Payouts and Payments","lvl3":"Transfer funds internally","lvl4":"Return transferred funds"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/payouts","lvl2":"https:\/\/docs.adyen.com\/pt\/payouts\/payout-service","lvl3":"https:\/\/docs.adyen.com\/pt\/payouts\/payout-service\/internal-fund-transfers","lvl4":"\/pt\/payouts\/payout-service\/internal-fund-transfers\/return-transfers"},"levels":5,"category":"","category_color":"","tags":["Return","transferred","funds"]}}
