{"title":"Book the remainder to your user","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 user.<\/p>\n<h2>Booking options<\/h2>\n<p>To book the remainder to your user, you have two options:<\/p>\n<ul>\n<li><a href=\"#use-original-amounts\">Option 1: Use the amounts from the original payment request<\/a>.<\/li>\n<li><a href=\"#adjust-refund-amount-settlement-currency\">Option 2: Adjust the amount to be refunded in the settlement currency<\/a>.<\/li>\n<\/ul>\n<p>When you book the remainder amount to your user:<\/p>\n<ul>\n<li>The refund amount is fixed in the processing currency<\/li>\n<li>The customer is credited the exact amount they originally paid in the processing currency<\/li>\n<li>Your user is debited a different amount than what they originally received. This new amount is the sum of the original payment amount and the remainder.<\/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 APIs:<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><li markdown=\"1\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/overview\" class=\" external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Foreign Exchange API<\/a> (format: <strong>ws@BalancePlatform.[YourBalancePlatform]<\/strong>). Only for <a href=\"#adjust-refund-amount-settlement-currency\">option 2<\/a>.<\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>API credential roles<\/strong><\/td>\n<td style=\"text-align: left;\">Only for <a href=\"#adjust-refund-amount-settlement-currency\">option 2<\/a>.<br><br>To use the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/overview\" class=\" external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Foreign Exchange API<\/a>, make sure you have the following role:<ul><li markdown=\"1\"><strong>Read FX rates role<\/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\/marketplaces\/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:<ul><li markdown=\"1\">Enable the use of the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/overview\" class=\" external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Foreign Exchange API<\/a> for your merchant account (only for <a href=\"#adjust-refund-amount-settlement-currency\">option 2<\/a>).<\/li><li markdown=\"1\">Configure the required currencies for your merchant account.<\/li><\/ul><\/li><li>Your payment must be captured before you can initiate the refund.<\/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.<\/p>\n<p>When refunding this payment, you want to book the remainder to your user. This means that the refund amount is fixed in the processing currency, and any mismatch is booked to your user in the settlement currency. To refund this payment:<\/p>\n<ol>\n<li>You calculate the amount the customer is refunded in the processing currency using the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/rates\/calculate<\/a> (only for <a href=\"#adjust-refund-amount-settlement-currency\">Option 2<\/a>).<\/li>\n<li>You send a refund request, specifying the refund amount in both currencies.<\/li>\n<li>When Adyen receives the request, we credit the customer and debit your user in their respective currencies. Your user is debited a different amount in the refund than what they originally received.<\/li>\n<\/ol>\n<h2 id=\"use-original-amounts\">Option 1: Use the amounts from the original payment request<\/h2>\n<p>To book the remainder to your user's balance account, 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 for the <code>amount<\/code>, and CZK 1000.00 for the <code>splits.amount<\/code>.<\/li>\n<li>In the splits array, add a split item for the remainder, with type <strong>Remainder<\/strong>. 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, specify your user's balance account. You do not need to specify the amount of the remainder.<\/li>\n<\/ul>\n<p>When Adyen receives your request, we credit the customer with their original payment amount and book the remainder to the balance account you specified in the <strong>Remainder<\/strong> split item.<\/p>\n<div class=\"accordion-shortcode adl-accordion adl-accordion--max-height-transition\" data-expand=\"true\" data-ignore=\"anchorjs-link\">\n    \n    <div class=\"adl-accordion__item\" style=\"\">\n        <div tabindex=\"0\" role=\"item\" aria-expanded=\"false\" class=\"adl-accordion__header\">\n            <i class=\"adl-accordion__toggle adl-icon-chevron-down\"><\/i>\n            <div class=\"adl-accordion__title-wrapper\" data-accordion=\"#example-refund-request\">\n                                    <h4 class=\"adl-accordion__title\">Example refund request<\/h4>\n                            <\/div>\n        <\/div>\n        <div role=\"region\" class=\"adl-accordion__content\">\n            \n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Refund request where the remainder is booked to your user'\" :id=\"'refund-original-amount-FX'\" :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;BA00000000000000000000001\\&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 v33.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;BA00000000000000000000001\\&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 v24.0.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;BA00000000000000000000001\\&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 v28.0.0\\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;BA00000000000000000000001\\&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 v23.3.0\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nconst client = new Client({ apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot; });\\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;BA00000000000000000000001\\&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 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\\\/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;BA00000000000000000000001\\&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 v13.3.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;BA00000000000000000000001\\&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 v10.1.1\\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; 'BA00000000000000000000001',\\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 v23.3.0\\nimport { Client, CheckoutAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nconst client = new Client({ apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot; });\\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;BA00000000000000000000001\\&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<p>You receive the following response:<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Response'\" :id=\"'response-original-amount'\" :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\\\":\\\"BA00000000000000000000001\\\",\\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\n        <\/div>\n    <\/div>\n<\/div>\n\n<h2 id=\"adjust-refund-amount-settlement-currency\">Option 2: Adjust the amount to be refunded in the settlement currency<\/h2>\n<p>To ensure that the customer receives the exact amount they originally paid in the processing currency, you can adjust the amount your user refunds in the settlement currency.<\/p>\n<h3>Calculate the refund amount in the settlement currency<\/h3>\n<p>To calculate the exact amount your user must refund in the settlement currency:<\/p>\n<ol>\n<li>\n<p>Contact 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:<\/p>\n<ul>\n<li>Enable the use of the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/overview\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Foreign Exchange API<\/a> for your merchant account.<\/li>\n<li>Configure the required currencies for your merchant account.<br><\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Make sure that you have the API key for the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/overview\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Foreign Exchange API<\/a>. Your credential has the format <strong>ws@BalancePlatform.[YourBalancePlatform]<\/strong>.<\/p>\n<\/li>\n<li>\n<p>Make a POST  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/rates\/calculate<\/a> request with an  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#request-exchangeCalculations\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">exchangeCalculations<\/a> array. Each item in the array defines a currency and value for which you want to perform a calculation. In each item of the array, specify:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#request-exchangeCalculations-type\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">type<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">Set to <strong>splitRefund<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#request-exchangeCalculations-sourceAmount-currency\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">sourceAmount.currency<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The processing currency.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#request-exchangeCalculations-sourceAmount-value\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">sourceAmount.value<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The refund amount in the processing currency, in minor units.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#request-exchangeCalculations-targetCurrency\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">targetCurrency<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The settlement currency.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#request-exchangeCalculations-exchangeSide\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">exchangeSide<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The operation performed on the currency provided in the <code>sourceAmount.currency<\/code> field. Set this to <strong>sell<\/strong>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>\n<p>In the response, note the following fields:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#request-exchangeCalculations-type\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">type<\/a><\/td>\n<td style=\"text-align: left;\">Returns <strong>splitRefund<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#request-exchangeCalculations-exchangeSide\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">exchangeSide<\/a><\/td>\n<td style=\"text-align: left;\">The operation performed on the currency provided in the <code>sourceAmount.currency<\/code> field. Returns <strong>sell<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#request-exchangeCalculations-sourceAmount-currency\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">sourceAmount.currency<\/a><\/td>\n<td style=\"text-align: left;\">The processing currency.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#request-exchangeCalculations-sourceAmount-value\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">sourceAmount.value<\/a><\/td>\n<td style=\"text-align: left;\">The refund amount in the processing currency, in minor units.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#responses-200-exchangeCalculations-targetAmount-currency\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">targetAmount.currency<\/a><\/td>\n<td style=\"text-align: left;\">The settlement currency.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#responses-200-exchangeCalculations-targetAmount-value\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">targetAmount.value<\/a><\/td>\n<td style=\"text-align: left;\">The refund amount in the settlement currency, in minor units. This is the amount your user refunds.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#responses-200-exchangeCalculations-appliedExchangeRate\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">appliedExchangeRate<\/a><\/td>\n<td style=\"text-align: left;\">The exchange rate to convert the processing currency to the settlement currency that includes Adyen's Markup.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ol>\n<div class=\"accordion-shortcode adl-accordion adl-accordion--max-height-transition\" data-expand=\"true\" data-ignore=\"anchorjs-link\">\n    \n    <div class=\"adl-accordion__item\" style=\"\">\n        <div tabindex=\"0\" role=\"item\" aria-expanded=\"false\" class=\"adl-accordion__header\">\n            <i class=\"adl-accordion__toggle adl-icon-chevron-down\"><\/i>\n            <div class=\"adl-accordion__title-wrapper\" data-accordion=\"#example-request\">\n                                    <h4 class=\"adl-accordion__title\">Example request<\/h4>\n                            <\/div>\n        <\/div>\n        <div role=\"region\" class=\"adl-accordion__content\">\n            \n<p>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. Here:<\/p>\n<ul>\n<li>The processing currency is PLN and the settlement currency is CZK.<\/li>\n<li>The refund amount is fixed at PLN 201.74 (the processing currency).<\/li>\n<li>\n<p>You must calculate the refund amount in CZK (the settlement currency). This is the amount your user refunds.<\/p>\n<p>Here is a POST  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/rates\/calculate<\/a> request to calculate the amount the customer receives in the refund, when the refund amount is fixed at PLN 201.74 (the processing currency).<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Calculate the cost of goods in the processing currency'\" :id=\"'calculate-user-refund-amount'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/balanceplatform-api-live.adyen.com\\\/fx\\\/api\\\/v1\\\/rates\\\/calculate \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X POST \\\\\\n-d '{\\n      \\&quot;exchangeCalculations\\&quot;: [\\n         {\\n            \\&quot;type\\&quot;: \\&quot;splitRefund\\&quot;,\\n            \\&quot;sourceAmount\\&quot;: {\\n               \\&quot;currency\\&quot;: \\&quot;PLN\\&quot;\\n               \\&quot;value\\&quot;: 20174\\n            },\\n            \\&quot;targetCurrency\\&quot;: \\&quot;CZK\\&quot;,\\n            \\&quot;exchangeSide\\&quot;: \\&quot;sell\\&quot;\\n         }\\n      ]\\n   }'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>You receive the following response:<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"exchangeCalculations\\\": [\\n      {\\n         \\\"type\\\": \\\"splitRefund\\\",\\n         \\\"exchangeSide\\\": \\\"sell\\\",\\n         \\\"sourceAmount\\\": {\\n            \\\"currency\\\": \\\"PLN\\\",\\n            \\\"value\\\": 20174\\n         },\\n         \\\"targetAmount\\\": {\\n            \\\"currency\\\": \\\"CZK\\\",\\n            \\\"value\\\": \\\"103231\\\"\\n         },\\n         \\\"appliedExchangeRate\\\": \\\"0.20174\\\"\\n      }\\n   ]\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>The  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/foreignexchange\/latest\/post\/rates\/calculate#responses-200-exchangeCalculations-targetAmount-value\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">targetAmount.value<\/a> field returns the adjusted amount in CZK that your user must refund in order for the customer to receive PLN 201.74 (the original payment amount). By increasing the amount your user refunds to CZK 1032.31, the customer will receive exactly PLN 201.74. Here, the remainder is the additional CZK 32.31 that you debit your user. You can include this adjusted refund amount in the <code>splits.amount.value<\/code> object of your refund request.<\/p>\n<\/li>\n<\/ul>\n\n        <\/div>\n    <\/div>\n<\/div>\n\n<h3>Send a refund request<\/h3>\n<p>To book the remainder to your user:<\/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 specifying the following fields for the currency conversion:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<th style=\"text-align: left;\">Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds#request-amount-value\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.value<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The original amount the customer paid in the processing currency.<\/td>\n<td style=\"text-align: left;\"><strong>amount.value: 20174<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds#request-amount-currency\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.currency<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The original processing currency.<\/td>\n<td style=\"text-align: left;\"><strong>amount.currency: \"PLN\"<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds#request-splits-amount-value\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">splits.amount.value<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The adjusted refund amount in the settlement currency. In case of multiple splits, the sum of the split amounts in the splits array must equal the adjusted refund amount in the settlement currency. Any mismatch will be booked to the balance account you specify in the split item with type <strong>Remainder<\/strong>.<\/td>\n<td style=\"text-align: left;\"><strong>splits.amount.value: 103231<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds#request-splits-amount-currency\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">splits.amount.currency<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The original settlement currency.<\/td>\n<td style=\"text-align: left;\"><strong>splits.amount.currency: \"CZK\"<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/(paymentPspReference)\/refunds#request-splits-type\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">splits.type<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The type of the split item. We recommend to always add a split item for the type <strong>Remainder<\/strong>.<\/td>\n<td style=\"text-align: left;\"><strong>split.type: BalanceAccount<\/strong><br><strong>split.type: Remainder<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>\n<p>The splits are guaranteed, and the refund is booked according to the data you provide in the splits array. Any mismatch or miscalculation is booked to the balance account you specify in the split item with type <strong>Remainder<\/strong>. You can reconcile these mismatches per transaction using the <a href=\"\/pt\/marketplaces\/reports-and-fees\/balance-platform-accounting-report\">Balance Platform Accounting Report<\/a>.<\/p>\n<\/li>\n<\/ol>\n<div class=\"accordion-shortcode adl-accordion adl-accordion--max-height-transition\" data-expand=\"true\" data-ignore=\"anchorjs-link\">\n    \n    <div class=\"adl-accordion__item\" style=\"\">\n        <div tabindex=\"0\" role=\"item\" aria-expanded=\"false\" class=\"adl-accordion__header\">\n            <i class=\"adl-accordion__toggle adl-icon-chevron-down\"><\/i>\n            <div class=\"adl-accordion__title-wrapper\" data-accordion=\"#example-refund-request\">\n                                    <h4 class=\"adl-accordion__title\">Example refund request<\/h4>\n                            <\/div>\n        <\/div>\n        <div role=\"region\" class=\"adl-accordion__content\">\n            \n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Refund request with adjusted refund amount in settlement currency'\" :id=\"'refund-adjusted'\" :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;:103231,\\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;BA00000000000000000000001\\&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 v33.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(103231L);\\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;BA00000000000000000000001\\&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 v24.0.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(103231);\\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;BA00000000000000000000001\\&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 v28.0.0\\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 = 103231\\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;BA00000000000000000000001\\&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 v23.3.0\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nconst client = new Client({ apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot; });\\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: 103231,\\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;BA00000000000000000000001\\&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 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\\\/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: 103231,\\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;BA00000000000000000000001\\&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 v13.3.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;: 103231,\\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;BA00000000000000000000001\\&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 v10.1.1\\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; 103231,\\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; 'BA00000000000000000000001',\\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 v23.3.0\\nimport { Client, CheckoutAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nconst client = new Client({ apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot; });\\n\\n\\\/\\\/ Create the request object(s)\\nconst splitAmount1: Types.checkout.SplitAmount = {\\n  currency: \\&quot;CZK\\&quot;,\\n  value: 103231\\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;BA00000000000000000000001\\&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<p>You receive the following response:<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Response'\" :id=\"'response-adjusted-user-amount'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"merchantAccount\\\":\\\"YOUR_MERCHANT_ACCOUNT\\\",\\n   \\\"paymentPspReference\\\":\\\"CW2FJFC2BVTFWR82\\\",\\n   \\\"pspReference\\\":\\\"GFM9HGC2BVTFWR82\\\",\\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\\\":103231\\n         },\\n         \\\"description\\\":\\\"YOUR_SPLIT_DESCRIPTION\\\",\\n         \\\"reference\\\":\\\"YOUR_SPLIT_REFERENCE\\\",\\n         \\\"type\\\":\\\"BalanceAccount\\\"\\n      },\\n      {\\n         \\\"account\\\":\\\"BA00000000000000000000001\\\",\\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\n        <\/div>\n    <\/div>\n<\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/marketplaces\/currency-conversion\/refunds\/your-user","articleFields":{"description":"Learn how to convert the currency of a refund and book the remainder to your user.","feedback_component":true,"parameters":{"directoryPath":"\/marketplaces","model":"marketplace"},"filters_component":false,"page_id":"7f6ea2bd-a801-49ac-9cae-77429d0c13c6"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/marketplaces\/currency-conversion\/refunds\/your-user","title":"Book the remainder to your user","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 user.\nBooking options\nTo book the remainder to your user, you have two options:\n\nOption 1: Use the amounts from the original payment request.\nOption 2: Adjust the amount to be refunded in the settlement currency.\n\nWhen you book the remainder amount to your user:\n\nThe refund amount is fixed in the processing currency\nThe customer is credited the exact amount they originally paid in the processing currency\nYour user is debited a different amount than what they originally received. This new amount is the sum of the original payment amount and the remainder.\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 APIs: Checkout API (format: ws@Company.[YourCompanyAccount]) Foreign Exchange API (format: ws@BalancePlatform.[YourBalancePlatform]). Only for option 2.\n\n\nAPI credential roles\nOnly for option 2.To use the  Foreign Exchange API, make sure you have the following role:Read FX rates role\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:Enable the use of the  Foreign Exchange API for your merchant account (only for option 2).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.\nWhen refunding this payment, you want to book the remainder to your user. This means that the refund amount is fixed in the processing currency, and any mismatch is booked to your user in the settlement currency. To refund this payment:\n\nYou calculate the amount the customer is refunded in the processing currency using the  \/rates\/calculate (only for Option 2).\nYou send a refund request, specifying the refund amount in both currencies.\nWhen Adyen receives the request, we credit the customer and debit your user in their respective currencies. Your user is debited a different amount in the refund than what they originally received.\n\nOption 1: Use the amounts from the original payment request\nTo book the remainder to your user's balance account, send 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 for the amount, and CZK 1000.00 for the splits.amount.\nIn the splits array, add a split item for the remainder, with type Remainder. In the  account field of this split item, specify your user's balance account. You do not need to specify the amount of the remainder.\n\nWhen Adyen receives your request, we credit the customer with their original payment amount and book the remainder to the balance account you specified in the Remainder split item.\n\n    \n    \n        \n            \n            \n                                    Example refund request\n                            \n        \n        \n            \n\n    \n\nYou receive the following response:\n\n    \n\n\n        \n    \n\n\nOption 2: Adjust the amount to be refunded in the settlement currency\nTo ensure that the customer receives the exact amount they originally paid in the processing currency, you can adjust the amount your user refunds in the settlement currency.\nCalculate the refund amount in the settlement currency\nTo calculate the exact amount your user must refund in the settlement currency:\n\n\nContact our Support Team to:\n\nEnable the use of the  Foreign Exchange API for your merchant account.\nConfigure the required currencies for your merchant account.\n\n\n\nMake sure that you have the API key for the  Foreign Exchange API. Your credential has the format ws@BalancePlatform.[YourBalancePlatform].\n\n\nMake a POST  \/rates\/calculate request with an  exchangeCalculations array. Each item in the array defines a currency and value for which you want to perform a calculation. In each item of the array, specify:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\n type\n\nSet to splitRefund\n\n\n sourceAmount.currency\n\nThe processing currency.\n\n\n sourceAmount.value\n\nThe refund amount in the processing currency, in minor units.\n\n\n targetCurrency\n\nThe settlement currency.\n\n\n exchangeSide\n\nThe operation performed on the currency provided in the sourceAmount.currency field. Set this to sell.\n\n\n\n\n\nIn the response, note the following fields:\n\n\n\nParameter\nDescription\n\n\n\n\n type\nReturns splitRefund\n\n\n exchangeSide\nThe operation performed on the currency provided in the sourceAmount.currency field. Returns sell.\n\n\n sourceAmount.currency\nThe processing currency.\n\n\n sourceAmount.value\nThe refund amount in the processing currency, in minor units.\n\n\n targetAmount.currency\nThe settlement currency.\n\n\n targetAmount.value\nThe refund amount in the settlement currency, in minor units. This is the amount your user refunds.\n\n\n appliedExchangeRate\nThe exchange rate to convert the processing currency to the settlement currency that includes Adyen's Markup.\n\n\n\n\n\n\n    \n    \n        \n            \n            \n                                    Example request\n                            \n        \n        \n            \nFor 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. Here:\n\nThe processing currency is PLN and the settlement currency is CZK.\nThe refund amount is fixed at PLN 201.74 (the processing currency).\n\nYou must calculate the refund amount in CZK (the settlement currency). This is the amount your user refunds.\nHere is a POST  \/rates\/calculate request to calculate the amount the customer receives in the refund, when the refund amount is fixed at PLN 201.74 (the processing currency).\n\n\n\nYou receive the following response:\n\n\n\nThe  targetAmount.value field returns the adjusted amount in CZK that your user must refund in order for the customer to receive PLN 201.74 (the original payment amount). By increasing the amount your user refunds to CZK 1032.31, the customer will receive exactly PLN 201.74. Here, the remainder is the additional CZK 32.31 that you debit your user. You can include this adjusted refund amount in the splits.amount.value object of your refund request.\n\n\n\n        \n    \n\n\nSend a refund request\nTo book the remainder to your user:\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 specifying the following fields for the currency conversion:\n\n\n\nParameter\nRequired\nDescription\nExample\n\n\n\n\n amount.value\n\nThe original amount the customer paid in the processing currency.\namount.value: 20174\n\n\n amount.currency\n\nThe original processing currency.\namount.currency: \"PLN\"\n\n\n splits.amount.value\n\nThe adjusted refund amount in the settlement currency. In case of multiple splits, the sum of the split amounts in the splits array must equal the adjusted refund amount in the settlement currency. Any mismatch will be booked to the balance account you specify in the split item with type Remainder.\nsplits.amount.value: 103231\n\n\n splits.amount.currency\n\nThe original settlement currency.\nsplits.amount.currency: \"CZK\"\n\n\n splits.type\n\nThe type of the split item. We recommend to always add a split item for the type Remainder.\nsplit.type: BalanceAccountsplit.type: Remainder\n\n\n\n\n\nThe splits are guaranteed, and the refund is booked according to the data you provide in the splits array. Any mismatch or miscalculation is booked to the balance account you specify in the split item with type Remainder. You can reconcile these mismatches per transaction using the Balance Platform Accounting Report.\n\n\n\n    \n    \n        \n            \n            \n                                    Example refund request\n                            \n        \n        \n            \n\n    \n\nYou receive the following response:\n\n    \n\n\n        \n    \n\n","type":"page","locale":"pt","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Marketplaces","lvl2":"Currency conversion","lvl3":"Convert the currency of a refund","lvl4":"Book the remainder to your user"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/marketplaces","lvl2":"https:\/\/docs.adyen.com\/pt\/marketplaces\/currency-conversion","lvl3":"https:\/\/docs.adyen.com\/pt\/marketplaces\/currency-conversion\/refunds","lvl4":"\/pt\/marketplaces\/currency-conversion\/refunds\/your-user"},"levels":5,"category":"Marketplaces","category_color":"green","tags":["remainder"]}}
