{"title":"Book the remainder to your platform","category":"default","creationDate":1676035020,"content":"<p><span style=\"color: #0ABF53;\"><span style=\"font-size: 20px;\"><strong>Limited availability<\/strong><\/span><\/span><br \/>\nCurrency conversion in currently in pilot phase. Some of the processes and documentation may change as the feature evolves. If you are interested in piloting currency conversion or have any feedback, reach out to your Adyen contact.<\/p>\n<hr \/>\n<p>When you refund a payment with currency conversion, the refund amounts may not match the amounts in the original payment request, resulting in a remainder.  For example, your user sold goods worth CZK 1000.00 to a customer who paid in PLN (PLN 201.74). Later, your user refunds the CZK 1000.00 to the customer, which results in a remainder of PLN 6.31. You can choose to book this remainder to your platform.<\/p>\n<p>When you book the remainder amount to the customer:<\/p>\n<ul>\n<li>Your user is debited the exact amount they received in the payment.<\/li>\n<li>The customer is credited the exact amount they originally paid.<\/li>\n<li>The balance from the remainder is booked to your liable balance account.<\/li>\n<\/ul>\n<h2>Requirements<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Integration type<\/strong><\/td>\n<td style=\"text-align: left;\">You must have an Adyen <a href=\"\/pt\/online-payments\/build-your-integration\">online payments integration and a checkout UI<\/a>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong><a href=\"\/pt\/development-resources\/api-credentials\">API credentials<\/a><\/strong><\/td>\n<td style=\"text-align: left;\">You must have credentials for the following API:<ul><li markdown=\"1\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/overview\" class=\" external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Checkout API<\/a> (format: <strong>ws@Company.[YourCompanyAccount]<\/strong>)<\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong><a href=\"\/pt\/development-resources\/webhooks\">Webhooks<\/a><\/strong><\/td>\n<td style=\"text-align: left;\">Ensure that your server can receive and accept <a href=\"\/pt\/development-resources\/webhooks\">standard webhooks<\/a>.<br>Subscribe to any of the following webhooks: <ul><li markdown=\"1\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/transfer-webhooks\/latest\/overview\" class=\" external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Transfer webhooks<\/a><\/li><li markdown=\"1\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/transaction-webhooks\/latest\/overview\" class=\" external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Transaction webhooks<\/a><\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong><a href=\"\/pt\/platforms\/verification-overview\/capabilities\">Capabilities<\/a><\/strong><\/td>\n<td style=\"text-align: left;\">Make sure that your account holders have the following capabilities:<ul><li markdown=\"1\"><strong>receivePayments<\/strong><\/li><li markdown=\"1\"><strong>receiveFromPlatformPayments<\/strong><\/li><li markdown=\"1\"><strong>sendToTransferInstrument<\/strong><\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\">Before you begin: <ul><li markdown=\"1\">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 configure the required currencies for your merchant account.<\/li><li markdown=\"1\">Your payment must be captured before you can initiate the refund.<\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>How it works<\/h2>\n<p>You process a payment with currency conversion on behalf of your user. The customer is debited in the processing currency and your user is credited in the settlement currency. When refunding this payment, you want to book the remainder to your platform. To do this:<\/p>\n<ol>\n<li>You send a refund request, specifying the original payment amounts in both currencies.<\/li>\n<li>When Adyen receives the request, we credit the customer and debit your user in their respective currencies. Any remainder is booked to your liable balance account.<\/li>\n<\/ol>\n<h2>Send a refund request<\/h2>\n<p>To book the remainder to your platform's liable balance account:<\/p>\n<ol>\n<li>\n<p>Make sure that you have the API key for the Checkout API. Your credential has the format <strong>ws@Company.[YourCompanyAccount]<\/strong>.<\/p>\n<\/li>\n<li>\n<p>Send a POST  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/{paymentPspReference}\/refunds<\/a> request.<\/p>\n<ul>\n<li>Use the values from the original payment for the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds#request-amount\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount<\/a> and  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds#request-splits-amount\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">splits.amount<\/a> objects of the request. For our example refund, this is PLN 201.74 as the <code>amount<\/code> and CZK 1000.00 as the <code>splits.amount<\/code>.<\/li>\n<li>In the splits array, add another split item for the remainder, with type <strong>Remainder<\/strong>. Enter your liable balance account ID in the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds#request-splits-account\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">account<\/a> field of this split item. You do not need to specify the amount of the remainder.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Refund request where the remainder is booked to your platform'\" :id=\"'refund-remainder-platform'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v72\\\/payments\\\/{paymentPspReference}\\\/refunds \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X POST \\\\\\n-d '{\\n    \\&quot;amount\\&quot;:{\\n        \\&quot;value\\&quot;:20174,\\n        \\&quot;currency\\&quot;:\\&quot;PLN\\&quot;\\n    },\\n    \\&quot;reference\\&quot;:\\&quot;YOUR_REFUND_REFERENCE\\&quot;,\\n    \\&quot;merchantAccount\\&quot;:\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n    \\&quot;splits\\&quot;:[\\n        {\\n            \\&quot;amount\\&quot;:{\\n                \\&quot;value\\&quot;:100000,\\n                \\&quot;currency\\&quot;:\\&quot;CZK\\&quot;\\n            },\\n            \\&quot;type\\&quot;:\\&quot;BalanceAccount\\&quot;,\\n            \\&quot;account\\&quot;:\\&quot;BA00000000000000000000001\\&quot;,\\n            \\&quot;reference\\&quot;:\\&quot;YOUR_SPLIT_REFERENCE\\&quot;,\\n            \\&quot;description\\&quot;:\\&quot;YOUR_SPLIT_DESCRIPTION\\&quot;\\n        },\\n        {\\n            \\&quot;type\\&quot;:\\&quot;Remainder\\&quot;,\\n            \\&quot;account\\&quot;:\\&quot;YOUR_LIABLE_ACCOUNT_ID\\&quot;,\\n            \\&quot;reference\\&quot;:\\&quot;YOUR_REMAINDER_REFERENCE\\&quot;,\\n            \\&quot;description\\&quot;:\\&quot;YOUR_REMAINDER_DESCRIPTION\\&quot;\\n        }\\n    ]\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v40.0.0\\nimport com.adyen.Client;\\nimport com.adyen.enums.Environment;\\nimport com.adyen.model.checkout.*;\\nimport java.time.OffsetDateTime;\\nimport java.util.*;\\nimport com.adyen.model.RequestOptions;\\nimport com.adyen.service.checkout.*;\\n\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nClient client = new Client(\\&quot;ADYEN_API_KEY\\&quot;, Environment.TEST);\\n\\n\\\/\\\/ Create the request object(s)\\nSplitAmount splitAmount1 = new SplitAmount()\\n  .currency(\\&quot;CZK\\&quot;)\\n  .value(100000L);\\n\\nAmount amount = new Amount()\\n  .currency(\\&quot;PLN\\&quot;)\\n  .value(20174L);\\n\\nSplit split1 = new Split()\\n  .reference(\\&quot;YOUR_SPLIT_REFERENCE\\&quot;)\\n  .amount(splitAmount1)\\n  .description(\\&quot;YOUR_SPLIT_DESCRIPTION\\&quot;)\\n  .type(Split.TypeEnum.BALANCEACCOUNT)\\n  .account(\\&quot;BA00000000000000000000001\\&quot;);\\n\\nSplit split2 = new Split()\\n  .reference(\\&quot;YOUR_REMAINDER_REFERENCE\\&quot;)\\n  .description(\\&quot;YOUR_REMAINDER_DESCRIPTION\\&quot;)\\n  .type(Split.TypeEnum.REMAINDER)\\n  .account(\\&quot;YOUR_LIABLE_ACCOUNT_ID\\&quot;);\\n\\nPaymentRefundRequest paymentRefundRequest = new PaymentRefundRequest()\\n  .reference(\\&quot;YOUR_REFUND_REFERENCE\\&quot;)\\n  .amount(amount)\\n  .splits(Arrays.asList(split1, split2))\\n  .merchantAccount(\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;);\\n\\n\\\/\\\/ Send the request\\nModificationsApi service = new ModificationsApi(client);\\nPaymentRefundResponse response = service.refundCapturedPayment(\\&quot;paymentPspReference\\&quot;, paymentRefundRequest, 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 v28.3.0\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Model\\\\Checkout\\\\Amount;\\nuse Adyen\\\\Model\\\\Checkout\\\\Split;\\nuse Adyen\\\\Model\\\\Checkout\\\\SplitAmount;\\nuse Adyen\\\\Model\\\\Checkout\\\\PaymentRefundRequest;\\nuse Adyen\\\\Service\\\\Checkout\\\\ModificationsApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_API_KEY\\&quot;);\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\n\\\/\\\/ Create the request object(s)\\n$splitAmount1 = new SplitAmount();\\n$splitAmount1\\n  -&gt;setCurrency(\\&quot;CZK\\&quot;)\\n  -&gt;setValue(100000);\\n\\n$amount = new Amount();\\n$amount\\n  -&gt;setCurrency(\\&quot;PLN\\&quot;)\\n  -&gt;setValue(20174);\\n\\n$split1 = new Split();\\n$split1\\n  -&gt;setReference(\\&quot;YOUR_SPLIT_REFERENCE\\&quot;)\\n  -&gt;setAmount($splitAmount1)\\n  -&gt;setDescription(\\&quot;YOUR_SPLIT_DESCRIPTION\\&quot;)\\n  -&gt;setType(\\&quot;BalanceAccount\\&quot;)\\n  -&gt;setAccount(\\&quot;BA00000000000000000000001\\&quot;);\\n\\n$split2 = new Split();\\n$split2\\n  -&gt;setReference(\\&quot;YOUR_REMAINDER_REFERENCE\\&quot;)\\n  -&gt;setDescription(\\&quot;YOUR_REMAINDER_DESCRIPTION\\&quot;)\\n  -&gt;setType(\\&quot;Remainder\\&quot;)\\n  -&gt;setAccount(\\&quot;YOUR_LIABLE_ACCOUNT_ID\\&quot;);\\n\\n$paymentRefundRequest = new PaymentRefundRequest();\\n$paymentRefundRequest\\n  -&gt;setReference(\\&quot;YOUR_REFUND_REFERENCE\\&quot;)\\n  -&gt;setAmount($amount)\\n  -&gt;setSplits(array($split1, $split2))\\n  -&gt;setMerchantAccount(\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;);\\n\\n$requestOptions['idempotencyKey'] = 'UUID';\\n\\n\\\/\\\/ Send the request\\n$service = new ModificationsApi($client);\\n$response = $service-&gt;refundCapturedPayment('paymentPspReference', $paymentRefundRequest, $requestOptions);&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen .NET API Library v32.2.1\\nusing Adyen;\\nusing Environment = Adyen.Model.Environment;\\nusing Adyen.Model;\\nusing Adyen.Model.Checkout;\\nusing Adyen.Service.Checkout;\\n\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nvar config = new Config()\\n{\\n    XApiKey = \\&quot;ADYEN_API_KEY\\&quot;,\\n    Environment = Environment.Test\\n};\\nvar client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\nSplitAmount splitAmount1 = new SplitAmount\\n{\\n  Currency = \\&quot;CZK\\&quot;,\\n  Value = 100000\\n};\\n\\nAmount amount = new Amount\\n{\\n  Currency = \\&quot;PLN\\&quot;,\\n  Value = 20174\\n};\\n\\nSplit split1 = new Split\\n{\\n  Reference = \\&quot;YOUR_SPLIT_REFERENCE\\&quot;,\\n  Amount = splitAmount1,\\n  Description = \\&quot;YOUR_SPLIT_DESCRIPTION\\&quot;,\\n  Type = Split.TypeEnum.BalanceAccount,\\n  Account = \\&quot;BA00000000000000000000001\\&quot;\\n};\\n\\nSplit split2 = new Split\\n{\\n  Reference = \\&quot;YOUR_REMAINDER_REFERENCE\\&quot;,\\n  Description = \\&quot;YOUR_REMAINDER_DESCRIPTION\\&quot;,\\n  Type = Split.TypeEnum.Remainder,\\n  Account = \\&quot;YOUR_LIABLE_ACCOUNT_ID\\&quot;\\n};\\n\\nPaymentRefundRequest paymentRefundRequest = new PaymentRefundRequest\\n{\\n  Reference = \\&quot;YOUR_REFUND_REFERENCE\\&quot;,\\n  Amount = amount,\\n  Splits = new List&lt;Split&gt;{ split1, split2 },\\n  MerchantAccount = \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;\\n};\\n\\n\\\/\\\/ Send the request\\nvar service = new ModificationsService(client);\\nvar response = service.RefundCapturedPayment(\\&quot;paymentPspReference\\&quot;, paymentRefundRequest, 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 v30.0.0\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nconst config = new Config({\\n  apiKey: \\&quot;ADYEN_API_KEY\\&quot;,\\n  environment: EnvironmentEnum.TEST\\n});\\n\\nconst client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\nconst paymentRefundRequest = {\\n  amount: {\\n    value: 20174,\\n    currency: \\&quot;PLN\\&quot;\\n  },\\n  reference: \\&quot;YOUR_REFUND_REFERENCE\\&quot;,\\n  merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  splits: [ {\\n    amount: {\\n      value: 100000,\\n      currency: \\&quot;CZK\\&quot;\\n    },\\n    type: \\&quot;BalanceAccount\\&quot;,\\n    account: \\&quot;BA00000000000000000000001\\&quot;,\\n    reference: \\&quot;YOUR_SPLIT_REFERENCE\\&quot;,\\n    description: \\&quot;YOUR_SPLIT_DESCRIPTION\\&quot;\\n  }, {\\n    type: \\&quot;Remainder\\&quot;,\\n    account: \\&quot;YOUR_LIABLE_ACCOUNT_ID\\&quot;,\\n    reference: \\&quot;YOUR_REMAINDER_REFERENCE\\&quot;,\\n    description: \\&quot;YOUR_REMAINDER_DESCRIPTION\\&quot;\\n  } ]\\n}\\n\\n\\\/\\\/ Send the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.ModificationsApi.refundCapturedPayment(\\&quot;paymentPspReference\\&quot;, paymentRefundRequest, { 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 v21.1.0\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/adyen\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/checkout\\&quot;\\n)\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nclient := adyen.NewClient(&amp;common.Config{\\n  ApiKey:      \\&quot;ADYEN_API_KEY\\&quot;,\\n  Environment: common.TestEnv,\\n})\\n\\n\\\/\\\/ Create the request object(s)\\nsplitAmount1 := checkout.SplitAmount{\\n  Currency: common.PtrString(\\&quot;CZK\\&quot;),\\n  Value: 100000,\\n}\\n\\namount := checkout.Amount{\\n  Currency: \\&quot;PLN\\&quot;,\\n  Value: 20174,\\n}\\n\\nsplit1 := checkout.Split{\\n  Reference: common.PtrString(\\&quot;YOUR_SPLIT_REFERENCE\\&quot;),\\n  Amount: &amp;splitAmount1,\\n  Description: common.PtrString(\\&quot;YOUR_SPLIT_DESCRIPTION\\&quot;),\\n  Type: \\&quot;BalanceAccount\\&quot;,\\n  Account: common.PtrString(\\&quot;BA00000000000000000000001\\&quot;),\\n}\\n\\nsplit2 := checkout.Split{\\n  Reference: common.PtrString(\\&quot;YOUR_REMAINDER_REFERENCE\\&quot;),\\n  Description: common.PtrString(\\&quot;YOUR_REMAINDER_DESCRIPTION\\&quot;),\\n  Type: \\&quot;Remainder\\&quot;,\\n  Account: common.PtrString(\\&quot;YOUR_LIABLE_ACCOUNT_ID\\&quot;),\\n}\\n\\npaymentRefundRequest := checkout.PaymentRefundRequest{\\n  Reference: common.PtrString(\\&quot;YOUR_REFUND_REFERENCE\\&quot;),\\n  Amount: amount,\\n  Splits: []checkout.Split{\\n      split1, split2,\\n  },\\n  MerchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n}\\n\\n\\\/\\\/ Send the request\\nservice := client.Checkout()\\nreq := service.ModificationsApi.RefundCapturedPaymentInput(\\&quot;paymentPspReference\\&quot;).IdempotencyKey(\\&quot;UUID\\&quot;).PaymentRefundRequest(paymentRefundRequest)\\nres, httpRes, err := service.ModificationsApi.RefundCapturedPayment(context.Background(), req)&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v14.0.0\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_API_KEY\\&quot;\\n# For the LIVE environment, also include your liveEndpointUrlPrefix.\\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;value\\&quot;: 20174,\\n    \\&quot;currency\\&quot;: \\&quot;PLN\\&quot;\\n  },\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_REFUND_REFERENCE\\&quot;,\\n  \\&quot;merchantAccount\\&quot;: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;splits\\&quot;: [ {\\n    \\&quot;amount\\&quot;: {\\n      \\&quot;value\\&quot;: 100000,\\n      \\&quot;currency\\&quot;: \\&quot;CZK\\&quot;\\n    },\\n    \\&quot;type\\&quot;: \\&quot;BalanceAccount\\&quot;,\\n    \\&quot;account\\&quot;: \\&quot;BA00000000000000000000001\\&quot;,\\n    \\&quot;reference\\&quot;: \\&quot;YOUR_SPLIT_REFERENCE\\&quot;,\\n    \\&quot;description\\&quot;: \\&quot;YOUR_SPLIT_DESCRIPTION\\&quot;\\n  }, {\\n    \\&quot;type\\&quot;: \\&quot;Remainder\\&quot;,\\n    \\&quot;account\\&quot;: \\&quot;YOUR_LIABLE_ACCOUNT_ID\\&quot;,\\n    \\&quot;reference\\&quot;: \\&quot;YOUR_REMAINDER_REFERENCE\\&quot;,\\n    \\&quot;description\\&quot;: \\&quot;YOUR_REMAINDER_DESCRIPTION\\&quot;\\n  } ]\\n}\\n\\n# Send the request\\nresult = adyen.checkout.modifications_api.refund_captured_payment(request=json_request, paymentPspReference=\\&quot;paymentPspReference\\&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 v11.0.0\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_API_KEY'\\n# For the LIVE environment, also include your liveEndpointUrlPrefix.\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Create the request object(s)\\nrequest_body = {\\n  :amount =&gt; {\\n    :value =&gt; 20174,\\n    :currency =&gt; 'PLN'\\n  },\\n  :reference =&gt; 'YOUR_REFUND_REFERENCE',\\n  :merchantAccount =&gt; 'YOUR_MERCHANT_ACCOUNT',\\n  :splits =&gt; [ {\\n    :amount =&gt; {\\n      :value =&gt; 100000,\\n      :currency =&gt; 'CZK'\\n    },\\n    :type =&gt; 'BalanceAccount',\\n    :account =&gt; 'BA00000000000000000000001',\\n    :reference =&gt; 'YOUR_SPLIT_REFERENCE',\\n    :description =&gt; 'YOUR_SPLIT_DESCRIPTION'\\n  }, {\\n    :type =&gt; 'Remainder',\\n    :account =&gt; 'YOUR_LIABLE_ACCOUNT_ID',\\n    :reference =&gt; 'YOUR_REMAINDER_REFERENCE',\\n    :description =&gt; 'YOUR_REMAINDER_DESCRIPTION'\\n  } ]\\n}\\n\\n# Send the request\\nresult = adyen.checkout.modifications_api.refund_captured_payment(request_body, 'paymentPspReference', 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 v30.0.0\\nimport { Client, CheckoutAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nconst config = new Config({\\n  apiKey: \\&quot;ADYEN_API_KEY\\&quot;,\\n  environment: EnvironmentEnum.TEST\\n});\\n\\nconst client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\nconst splitAmount1: Types.checkout.SplitAmount = {\\n  currency: \\&quot;CZK\\&quot;,\\n  value: 100000\\n};\\n\\nconst amount: Types.checkout.Amount = {\\n  currency: \\&quot;PLN\\&quot;,\\n  value: 20174\\n};\\n\\nconst split1: Types.checkout.Split = {\\n  reference: \\&quot;YOUR_SPLIT_REFERENCE\\&quot;,\\n  amount: splitAmount1,\\n  description: \\&quot;YOUR_SPLIT_DESCRIPTION\\&quot;,\\n  type: Types.checkout.Split.TypeEnum.BalanceAccount,\\n  account: \\&quot;BA00000000000000000000001\\&quot;\\n};\\n\\nconst split2: Types.checkout.Split = {\\n  reference: \\&quot;YOUR_REMAINDER_REFERENCE\\&quot;,\\n  description: \\&quot;YOUR_REMAINDER_DESCRIPTION\\&quot;,\\n  type: Types.checkout.Split.TypeEnum.Remainder,\\n  account: \\&quot;YOUR_LIABLE_ACCOUNT_ID\\&quot;\\n};\\n\\nconst paymentRefundRequest: Types.checkout.PaymentRefundRequest = {\\n  reference: \\&quot;YOUR_REFUND_REFERENCE\\&quot;,\\n  amount: amount,\\n  splits: [split1, split2],\\n  merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;\\n};\\n\\n\\\/\\\/ Send the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.ModificationsApi.refundCapturedPayment(\\&quot;paymentPspReference\\&quot;, paymentRefundRequest, { 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>You receive the following response:<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Response'\" :id=\"'response-liable'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"merchantAccount\\\":\\\"YOUR_MERCHANT_ACCOUNT\\\",\\n   \\\"paymentPspReference\\\":\\\"MNTQFKBDG3RZNN82\\\",\\n   \\\"pspReference\\\":\\\"NZK8QPBDG3RZNN82\\\",\\n   \\\"reference\\\":\\\"YOUR_REFUND_REFERENCE\\\",\\n   \\\"status\\\":\\\"received\\\",\\n   \\\"amount\\\":{\\n      \\\"currency\\\":\\\"PLN\\\",\\n      \\\"value\\\":20174\\n   },\\n   \\\"splits\\\":[\\n      {\\n         \\\"account\\\":\\\"BA00000000000000000000001\\\",\\n         \\\"amount\\\":{\\n            \\\"currency\\\":\\\"CZK\\\",\\n            \\\"value\\\":100000\\n         },\\n         \\\"description\\\":\\\"YOUR_SPLIT_DESCRIPTION\\\",\\n         \\\"reference\\\":\\\"YOUR_SPLIT_REFERENCE\\\",\\n         \\\"type\\\":\\\"BalanceAccount\\\"\\n      },\\n      {\\n         \\\"account\\\":\\\"YOUR_LIABLE_ACCOUNT_ID\\\",\\n         \\\"description\\\":\\\"YOUR_REMAINDER_DESCRIPTION\\\",\\n         \\\"reference\\\":\\\"YOUR_REMAINDER_REFERENCE\\\",\\n         \\\"type\\\":\\\"Remainder\\\"\\n      }\\n   ]\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>","url":"https:\/\/docs.adyen.com\/pt\/platforms\/online-payments\/currency-conversion\/refunds\/your-platform","articleFields":{"description":"Learn how to convert the currency of a refund and book the remainder to your platform.","feedback_component":true,"parameters":{"directoryPath":"\/platforms","model":"platform"},"filters_component":false,"page_id":"7f6ea2bd-a801-49ac-9cae-77429d0c13c6"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/platforms\/online-payments\/currency-conversion\/refunds\/your-platform","title":"Book the remainder to your platform","content":"Limited availability\nCurrency conversion in currently in pilot phase. Some of the processes and documentation may change as the feature evolves. If you are interested in piloting currency conversion or have any feedback, reach out to your Adyen contact.\n\nWhen you refund a payment with currency conversion, the refund amounts may not match the amounts in the original payment request, resulting in a remainder.  For example, your user sold goods worth CZK 1000.00 to a customer who paid in PLN (PLN 201.74). Later, your user refunds the CZK 1000.00 to the customer, which results in a remainder of PLN 6.31. You can choose to book this remainder to your platform.\nWhen you book the remainder amount to the customer:\n\nYour user is debited the exact amount they received in the payment.\nThe customer is credited the exact amount they originally paid.\nThe balance from the remainder is booked to your liable balance account.\n\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nYou must have an Adyen online payments integration and a checkout UI.\n\n\nAPI credentials\nYou must have credentials for the following API: Checkout API (format: ws@Company.[YourCompanyAccount])\n\n\nWebhooks\nEnsure that your server can receive and accept standard webhooks.Subscribe to any of the following webhooks:  Transfer webhooks Transaction webhooks\n\n\nCapabilities\nMake sure that your account holders have the following capabilities:receivePaymentsreceiveFromPlatformPaymentssendToTransferInstrument\n\n\nSetup steps\nBefore you begin: Ask our Support Team to configure the required currencies for your merchant account.Your payment must be captured before you can initiate the refund.\n\n\n\nHow it works\nYou process a payment with currency conversion on behalf of your user. The customer is debited in the processing currency and your user is credited in the settlement currency. When refunding this payment, you want to book the remainder to your platform. To do this:\n\nYou send a refund request, specifying the original payment amounts in both currencies.\nWhen Adyen receives the request, we credit the customer and debit your user in their respective currencies. Any remainder is booked to your liable balance account.\n\nSend a refund request\nTo book the remainder to your platform's liable balance account:\n\n\nMake sure that you have the API key for the Checkout API. Your credential has the format ws@Company.[YourCompanyAccount].\n\n\nSend a POST  \/payments\/{paymentPspReference}\/refunds request.\n\nUse the values from the original payment for the  amount and  splits.amount objects of the request. For our example refund, this is PLN 201.74 as the amount and CZK 1000.00 as the splits.amount.\nIn the splits array, add another split item for the remainder, with type Remainder. Enter your liable balance account ID in the  account field of this split item. You do not need to specify the amount of the remainder.\n\n\n\n\n\n\nYou receive the following response:\n\n\n\n\n","type":"page","locale":"pt","boost":15,"hierarchy":{"lvl0":"Home","lvl1":"Platforms","lvl2":"Process online payments","lvl3":"Currency conversion","lvl4":"Convert the currency of a refund","lvl5":"Book the remainder to your platform"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/platforms","lvl2":"https:\/\/docs.adyen.com\/pt\/platforms\/online-payments","lvl3":"https:\/\/docs.adyen.com\/pt\/platforms\/online-payments\/currency-conversion","lvl4":"https:\/\/docs.adyen.com\/pt\/platforms\/online-payments\/currency-conversion\/refunds","lvl5":"\/pt\/platforms\/online-payments\/currency-conversion\/refunds\/your-platform"},"levels":6,"category":"Platforms","category_color":"green","tags":["remainder","platform"]}}
