---
title: "Fix the cost of goods in the processing currency"
description: "Learn how to convert the currency of a payment when the cost of the goods is fixed in the processing currency"
url: "https://docs.adyen.com/marketplaces/currency-conversion/payments/fix-processing-currency"
source_url: "https://docs.adyen.com/marketplaces/currency-conversion/payments/fix-processing-currency.md"
canonical: "https://docs.adyen.com/marketplaces/currency-conversion/payments/fix-processing-currency"
last_modified: "2023-02-10T14:17:00+01:00"
language: "en"
---

# Fix the cost of goods in the processing currency

Learn how to convert the currency of a payment when the cost of the goods is fixed in the processing currency

[View source](/marketplaces/currency-conversion/payments/fix-processing-currency.md)

**Limited availability**\
Currency 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.

***

When you fix the cost of the goods in the processing currency, the customer always pays the same, fixed amount in their currency of choice (the processing currency). The amount your user receives in the settlement currency is not fixed and depends on the prevailing exchange rate and Adyen's conversion markup.

## Requirements

| Requirement                                                          | Description                                                                                                                                                                                                                                                                                                                                     |
| -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Integration type**                                                 | You must have an Adyen [online payments integration and a checkout UI](/online-payments/build-your-integration).                                                                                                                                                                                                                                |
| **[API credentials](/development-resources/api-credentials)**        | You must have credentials for the following APIs:- [Checkout API](https://docs.adyen.com/api-explorer/Checkout/latest/overview) (format: **ws\@Company.\[YourCompanyAccount]**)
- [Foreign Exchange API](https://docs.adyen.com/api-explorer/foreignexchange/latest/overview) (format: **ws\@BalancePlatform.\[YourBalancePlatform]**).         |
| **API credential roles**                                             | To use the [Foreign Exchange API](https://docs.adyen.com/api-explorer/foreignexchange/latest/overview), make sure you have the following role:- **Read FX rates role**                                                                                                                                                                          |
| **[Webhooks](/development-resources/webhooks)**                      | Ensure that your server can receive and accept [standard webhooks](/development-resources/webhooks). Subscribe to any of the following webhooks:- [Transfer webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/latest/overview)
- [Transaction webhooks](https://docs.adyen.com/api-explorer/transaction-webhooks/latest/overview) |
| **[Capabilities](/marketplaces/verification-overview/capabilities)** | Make sure that your account holders have the following capabilities:- **receivePayments**
- **receiveFromPlatformPayments**
- **sendToTransferInstrument**                                                                                                                                                                                      |
| **Setup steps**                                                      | Before you begin:- Ask our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to:

  * Enable the use of the [Foreign Exchange API](https://docs.adyen.com/api-explorer/foreignexchange/latest/overview) for your merchant account.
  * Configure the required currencies for your merchant account.            |

## How it works

If the cost of the goods in the processing currency (the currency in which the customer pays) is fixed:

1. [You calculate the amount your user receives in the settlement currency using the Foreign Exchange API](#calculate-the-amount-in-the-settlement-currency).
2. [You make a POST `/payments` request, specifying the cost of the goods in both currencies](#send-a-payment-request-with-the-calculated-amount).
3. When Adyen receives the request, we debit the customer and credit your user in their respective currencies.

## Calculate the amount in the settlement currency

To calculate the exact amount your user receives in their currency of choice (the settlement currency):

1. Contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to:

   * Enable the use of the [Foreign Exchange API](https://docs.adyen.com/api-explorer/foreignexchange/latest/overview) for your merchant account.
   * Configure the required currencies for your merchant account.

2. Make sure that you have the API key for the [Foreign Exchange API](https://docs.adyen.com/api-explorer/foreignexchange/latest/overview). Your credential has the format **ws\@BalancePlatform.\[YourBalancePlatform]**.

3. Make a POST [/rates/calculate](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate) request with an [exchangeCalculations](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#request-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:

   | Parameter                                                                                                                                                   | Required                                                                                                      | Description                                                                                                                      |
   | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
   | [type](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#request-exchangeCalculations-type)                                   | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | Set to **splitPayment**                                                                                                          |
   | [sourceAmount.currency](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#request-exchangeCalculations-sourceAmount-currency) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The processing currency.                                                                                                         |
   | [sourceAmount.value](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#request-exchangeCalculations-sourceAmount-value)       | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The cost of the goods in the processing currency, in minor units.                                                                |
   | [targetCurrency](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#request-exchangeCalculations-targetCurrency)               | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The settlement currency.                                                                                                         |
   | [exchangeSide](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#request-exchangeCalculations-exchangeSide)                   | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The operation performed on the fixed currency (the currency provided in the `sourceAmount.currency` field. Set this to **sell**. |

4. In the response, note the following fields:

   | **Parameter**                                                                                                                                                     | **Description**                                                                                                               |
   | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
   | [type](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#request-exchangeCalculations-type)                                         | Returns **splitPayment**                                                                                                      |
   | [exchangeSide](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#request-exchangeCalculations-exchangeSide)                         | The operation performed on the fixed currency (the currency provided in the `sourceAmount.currency` field). Returns **sell**. |
   | [sourceAmount.currency](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#request-exchangeCalculations-sourceAmount-currency)       | The processing currency.                                                                                                      |
   | [sourceAmount.value](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#request-exchangeCalculations-sourceAmount-value)             | The cost of the goods in the processing currency, in minor units.                                                             |
   | [targetAmount.currency](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#responses-200-exchangeCalculations-targetAmount-currency) | The settlement currency.                                                                                                      |
   | [targetAmount.value](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#responses-200-exchangeCalculations-targetAmount-value)       | The cost of the goods in the settlement currency, in minor units. This is the amount your user receives.                      |
   | [appliedExchangeRate](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#responses-200-exchangeCalculations-appliedExchangeRate)     | The exchange rate to convert the processing currency to the settlement currency that includes Adyen's Markup.                 |

   **

   #### Example request

   For example, your user sells goods worth PLN 200.00 to a customer:

   * Your user accepts CZK (the settlement currency).
   * The customer pays in PLN (the processing currency).
   * The cost of the goods is fixed in PLN (the processing currency).
   * You must calculate the cost of the goods in CZK (the settlement currency). This is the amount your user receives.

   Here is a POST [/rates/calculate](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate) request to calculate the amount your user receives, when the cost of the goods is fixed at PLN 200.00 (the processing currency).

   **Calculate the cost of the goods in the settlement currency**

   ```bash
   curl https://balanceplatform-api-live.adyen.com/fx/api/v1/rates/calculate \
    -H 'x-api-key: ADYEN_API_KEY' \
    -H 'content-type: application/json' \
    -X POST \
    -d '{
         "exchangeCalculations": [
            {
               "type": "splitPayment",
               "sourceAmount": {
                  "currency": "PLN",
                  "value": 20000
               },
               "targetCurrency": "CZK",
               "exchangeSide": "sell"
            }
         ]
      }'
   ```

   You receive the following response:

   ```json
   {
      "exchangeCalculations": [
         {
            "type": "splitPayment",
            "exchangeSide": "sell",
            "sourceAmount": {
               "currency": "PLN",
               "value": 20000
            },
            "targetAmount": {
               "currency": "CZK",
               "value": "1015.31"
            },
            "appliedExchangeRate": "5.07655"
         }
      ]
   }
   ```

   The [targetAmount.value](https://docs.adyen.com/api-explorer/foreignexchange/latest/post/rates/calculate#responses-200-exchangeCalculations-targetAmount-value) field returns the amount your user receives in CZK when the customer pays PLN 200.00. Here, your user receives CZK 1015.31 when the customer pays PLN 200.00.

## Send a payment request with the calculated amount

1. Make sure that you have the API key for the Checkout API. Your credential has the format **ws\@Company.\[YourCompanyAccount]**.

2. Send a POST [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments), [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions), or [/payments/{paymentPspReference}/captures](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures) request, specifying the following fields for the currency conversion:

   | Parameter                | Required                                                                                                      | Description                                                                                                                                                                                                                                                                                      | Example                                                                             |
   | ------------------------ | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
   | `amount.value`           | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The cost of the goods in the processing currency, calculated in [step 1](#1-calculate-the-amount-in-the-settlement-currency).                                                                                                                                                                    | **amount.value: 20000**                                                             |
   | `amount.currency`        | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The currency in which the customer pays.                                                                                                                                                                                                                                                         | **amount.currency: "PLN"**                                                          |
   | `splits.amount.value`    | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The cost of the goods in the settlement currency. In case of multiple splits, the sum of the split amounts in the splits array must equal the cost of the goods in the settlement currency. Any mismatch is booked to the balance account you specify in the split item with type **Remainder**. | **splits.amount.value: 101531**                                                     |
   | `splits.amount.currency` | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The settlement currency. This is the currency in which your user receives the funds.                                                                                                                                                                                                             | **splits.amount.currency: "CZK"**                                                   |
   | `splits.type`            | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The type of the split item. We recommend to always add a split item for the **Remainder** and the [transaction fees](/marketplaces/transaction-fees).                                                                                                                                            | **split.type: BalanceAccount** **split.type: PaymentFee** **split.type: Remainder** |

   **Payment request with currency conversion**

   #### curl

   ```bash
   curl https://checkout-test.adyen.com/v72/payments \
   -H 'x-api-key: ADYEN_API_KEY' \
   -H 'content-type: application/json' \
   -X POST \
   -d '{
       "paymentMethod": {
           "type": "scheme",
           "number": "4111111111111111",
           "cvc": "737",
           "expiryMonth": "03",
           "expiryYear": "2030",
           "holderName": "John Doe"
       },
       "billingAddress": {
           "city":"London",
           "country":"GB",
           "houseNumberOrName":"10",
           "postalCode":"SW1A 2AA",
           "street":"Downing Street"
       },
       "amount": {
           "value": 20174,
           "currency": "PLN"
       },
       "reference": "YOUR_PAYMENT_REFERENCE",
       "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
       "splits": [
           {
               "type": "BalanceAccount",
               "account": "BA00000000000000000000001",
               "amount": {
                   "currency": "CZK",
                   "value": 100000
               },
               "reference": "YOUR_SPLIT_REFERENCE_1",
               "description": "YOUR_SPLIT_DESCRIPTION_1"
           },
           {
               "type": "Remainder",
               "account": "BA00000000000000000000001",
               "reference": "YOUR_REMAINDER_REFERENCE",
               "description": "YOUR_REMAINDER_DESCRIPTION"
           },
           {
               "type": "PaymentFee",
               "account": "BA00000000000000000000001",
               "reference": "YOUR_PAYMENT-FEE_REFERENCE",
               "description": "YOUR_PAYMENT-FEE_DESCRIPTION"
           }
       ]
   }'
   ```

   #### Java

   ```java
   // Adyen Java API Library v33.0.0
   import com.adyen.Client;
   import com.adyen.enums.Environment;
   import com.adyen.model.checkout.*;
   import java.time.OffsetDateTime;
   import java.util.*;
   import com.adyen.model.RequestOptions;
   import com.adyen.service.checkout.*;

   // For the LIVE environment, also include your liveEndpointUrlPrefix.
   Client client = new Client("ADYEN_API_KEY", Environment.TEST);

   // Create the request object(s)
   SplitAmount splitAmount1 = new SplitAmount()
     .currency("CZK")
     .value(100000L);

   Amount amount = new Amount()
     .currency("PLN")
     .value(20174L);

   Split split1 = new Split()
     .reference("YOUR_SPLIT_REFERENCE_1")
     .amount(splitAmount1)
     .description("YOUR_SPLIT_DESCRIPTION_1")
     .type(Split.TypeEnum.BALANCEACCOUNT)
     .account("BA00000000000000000000001");

   Split split2 = new Split()
     .reference("YOUR_REMAINDER_REFERENCE")
     .description("YOUR_REMAINDER_DESCRIPTION")
     .type(Split.TypeEnum.REMAINDER)
     .account("BA00000000000000000000001");

   Split split3 = new Split()
     .reference("YOUR_PAYMENT-FEE_REFERENCE")
     .description("YOUR_PAYMENT-FEE_DESCRIPTION")
     .type(Split.TypeEnum.PAYMENTFEE)
     .account("BA00000000000000000000001");

   CardDetails cardDetails = new CardDetails()
     .number("4111111111111111")
     .cvc("737")
     .holderName("John Doe")
     .expiryMonth("03")
     .expiryYear("2030")
     .type(CardDetails.TypeEnum.SCHEME);

   BillingAddress billingAddress = new BillingAddress()
     .country("GB")
     .city("London")
     .houseNumberOrName("10")
     .street("Downing Street")
     .postalCode("SW1A 2AA");

   PaymentRequest paymentRequest = new PaymentRequest()
     .reference("YOUR_PAYMENT_REFERENCE")
     .amount(amount)
     .splits(Arrays.asList(split1, split2, split3))
     .merchantAccount("YOUR_MERCHANT_ACCOUNT")
     .paymentMethod(new CheckoutPaymentMethod(cardDetails))
     .billingAddress(billingAddress);

   // Send the request
   PaymentsApi service = new PaymentsApi(client);
   PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID"));
   ```

   #### PHP

   ```php
   <?php
   // Adyen PHP API Library v24.0.0
   use Adyen\Client;
   use Adyen\Environment;
   use Adyen\Model\Checkout\Amount;
   use Adyen\Model\Checkout\Split;
   use Adyen\Model\Checkout\CheckoutPaymentMethod;
   use Adyen\Model\Checkout\BillingAddress;
   use Adyen\Model\Checkout\SplitAmount;
   use Adyen\Model\Checkout\PaymentRequest;
   use Adyen\Service\Checkout\PaymentsApi;

   $client = new Client();
   $client->setXApiKey("ADYEN_API_KEY");
   // For the LIVE environment, also include your liveEndpointUrlPrefix.
   $client->setEnvironment(Environment::TEST);


   // Create the request object(s)
   $splitAmount1 = new SplitAmount();
   $splitAmount1
     ->setCurrency("CZK")
     ->setValue(100000);

   $amount = new Amount();
   $amount
     ->setCurrency("PLN")
     ->setValue(20174);

   $split1 = new Split();
   $split1
     ->setReference("YOUR_SPLIT_REFERENCE_1")
     ->setAmount($splitAmount1)
     ->setDescription("YOUR_SPLIT_DESCRIPTION_1")
     ->setType("BalanceAccount")
     ->setAccount("BA00000000000000000000001");

   $split2 = new Split();
   $split2
     ->setReference("YOUR_REMAINDER_REFERENCE")
     ->setDescription("YOUR_REMAINDER_DESCRIPTION")
     ->setType("Remainder")
     ->setAccount("BA00000000000000000000001");

   $split3 = new Split();
   $split3
     ->setReference("YOUR_PAYMENT-FEE_REFERENCE")
     ->setDescription("YOUR_PAYMENT-FEE_DESCRIPTION")
     ->setType("PaymentFee")
     ->setAccount("BA00000000000000000000001");

   $checkoutPaymentMethod = new CheckoutPaymentMethod();
   $checkoutPaymentMethod
     ->setNumber("4111111111111111")
     ->setCvc("737")
     ->setHolderName("John Doe")
     ->setExpiryMonth("03")
     ->setExpiryYear("2030")
     ->setType("scheme");

   $billingAddress = new BillingAddress();
   $billingAddress
     ->setCountry("GB")
     ->setCity("London")
     ->setHouseNumberOrName("10")
     ->setStreet("Downing Street")
     ->setPostalCode("SW1A 2AA");

   $paymentRequest = new PaymentRequest();
   $paymentRequest
     ->setReference("YOUR_PAYMENT_REFERENCE")
     ->setAmount($amount)
     ->setSplits(array($split1, $split2, $split3))
     ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT")
     ->setPaymentMethod($checkoutPaymentMethod)
     ->setBillingAddress($billingAddress);

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

   // Send the request
   $service = new PaymentsApi($client);
   $response = $service->payments($paymentRequest, $requestOptions);
   ```

   #### C\#

   ```cs
   // Adyen .net API Library v27.0.0
   using Adyen;
   using Environment = Adyen.Model.Environment;
   using Adyen.Model;
   using Adyen.Model.Checkout;
   using Adyen.Service.Checkout;

   // For the LIVE environment, also include your liveEndpointUrlPrefix.
   var config = new Config()
   {
       XApiKey = "ADYEN_API_KEY",
       Environment = Environment.Test
   };
   var client = new Client(config);

   // Create the request object(s)
   SplitAmount splitAmount1 = new SplitAmount
   {
     Currency = "CZK",
     Value = 100000
   };

   Amount amount = new Amount
   {
     Currency = "PLN",
     Value = 20174
   };

   Split split1 = new Split
   {
     Reference = "YOUR_SPLIT_REFERENCE_1",
     Amount = splitAmount1,
     Description = "YOUR_SPLIT_DESCRIPTION_1",
     Type = Split.TypeEnum.BalanceAccount,
     Account = "BA00000000000000000000001"
   };

   Split split2 = new Split
   {
     Reference = "YOUR_REMAINDER_REFERENCE",
     Description = "YOUR_REMAINDER_DESCRIPTION",
     Type = Split.TypeEnum.Remainder,
     Account = "BA00000000000000000000001"
   };

   Split split3 = new Split
   {
     Reference = "YOUR_PAYMENT-FEE_REFERENCE",
     Description = "YOUR_PAYMENT-FEE_DESCRIPTION",
     Type = Split.TypeEnum.PaymentFee,
     Account = "BA00000000000000000000001"
   };

   CardDetails cardDetails = new CardDetails
   {
     Number = "4111111111111111",
     Cvc = "737",
     HolderName = "John Doe",
     ExpiryMonth = "03",
     ExpiryYear = "2030",
     Type = CardDetails.TypeEnum.Scheme
   };

   BillingAddress billingAddress = new BillingAddress
   {
     Country = "GB",
     City = "London",
     HouseNumberOrName = "10",
     Street = "Downing Street",
     PostalCode = "SW1A 2AA"
   };

   PaymentRequest paymentRequest = new PaymentRequest
   {
     Reference = "YOUR_PAYMENT_REFERENCE",
     Amount = amount,
     Splits = new List<Split>{ split1, split2, split3 },
     MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
     PaymentMethod = new CheckoutPaymentMethod(cardDetails),
     BillingAddress = billingAddress
   };

   // Send the request
   var service = new PaymentsService(client);
   var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
   ```

   #### NodeJS (JavaScript)

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

   // For the LIVE environment, also include your liveEndpointUrlPrefix.
   const client = new Client({ apiKey: "ADYEN_API_KEY", environment: "TEST" });

   // Create the request object(s)
   const paymentRequest = {
     paymentMethod: {
       type: "scheme",
       number: "4111111111111111",
       cvc: "737",
       expiryMonth: "03",
       expiryYear: "2030",
       holderName: "John Doe"
     },
     billingAddress: {
       city: "London",
       country: "GB",
       houseNumberOrName: "10",
       postalCode: "SW1A 2AA",
       street: "Downing Street"
     },
     amount: {
       value: 20174,
       currency: "PLN"
     },
     reference: "YOUR_PAYMENT_REFERENCE",
     merchantAccount: "YOUR_MERCHANT_ACCOUNT",
     splits: [ {
       type: "BalanceAccount",
       account: "BA00000000000000000000001",
       amount: {
         currency: "CZK",
         value: 100000
       },
       reference: "YOUR_SPLIT_REFERENCE_1",
       description: "YOUR_SPLIT_DESCRIPTION_1"
     }, {
       type: "Remainder",
       account: "BA00000000000000000000001",
       reference: "YOUR_REMAINDER_REFERENCE",
       description: "YOUR_REMAINDER_DESCRIPTION"
     }, {
       type: "PaymentFee",
       account: "BA00000000000000000000001",
       reference: "YOUR_PAYMENT-FEE_REFERENCE",
       description: "YOUR_PAYMENT-FEE_DESCRIPTION"
     } ]
   }

   // Send the request
   const checkoutAPI = new CheckoutAPI(client);
   const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
   ```

   #### Go

   ```go
   // Adyen Go API Library v16.3.0
   import (
     "context"
     "github.com/adyen/adyen-go-api-library/v16/src/common"
     "github.com/adyen/adyen-go-api-library/v16/src/adyen"
     "github.com/adyen/adyen-go-api-library/v16/src/checkout"
   )
   // For the LIVE environment, also include your liveEndpointUrlPrefix.
   client := adyen.NewClient(&common.Config{
     ApiKey:      "ADYEN_API_KEY",
     Environment: common.TestEnv,
   })

   // Create the request object(s)
   splitAmount1 := checkout.SplitAmount{
     Currency: common.PtrString("CZK"),
     Value: 100000,
   }

   amount := checkout.Amount{
     Currency: "PLN",
     Value: 20174,
   }

   split1 := checkout.Split{
     Reference: common.PtrString("YOUR_SPLIT_REFERENCE_1"),
     Amount: &splitAmount1,
     Description: common.PtrString("YOUR_SPLIT_DESCRIPTION_1"),
     Type: "BalanceAccount",
     Account: common.PtrString("BA00000000000000000000001"),
   }

   split2 := checkout.Split{
     Reference: common.PtrString("YOUR_REMAINDER_REFERENCE"),
     Description: common.PtrString("YOUR_REMAINDER_DESCRIPTION"),
     Type: "Remainder",
     Account: common.PtrString("BA00000000000000000000001"),
   }

   split3 := checkout.Split{
     Reference: common.PtrString("YOUR_PAYMENT-FEE_REFERENCE"),
     Description: common.PtrString("YOUR_PAYMENT-FEE_DESCRIPTION"),
     Type: "PaymentFee",
     Account: common.PtrString("BA00000000000000000000001"),
   }

   cardDetails := checkout.CardDetails{
     Number: common.PtrString("4111111111111111"),
     Cvc: common.PtrString("737"),
     HolderName: common.PtrString("John Doe"),
     ExpiryMonth: common.PtrString("03"),
     ExpiryYear: common.PtrString("2030"),
     Type: common.PtrString("scheme"),
   }

   billingAddress := checkout.BillingAddress{
     Country: "GB",
     City: "London",
     HouseNumberOrName: "10",
     Street: "Downing Street",
     PostalCode: "SW1A 2AA",
   }

   paymentRequest := checkout.PaymentRequest{
     Reference: "YOUR_PAYMENT_REFERENCE",
     Amount: amount,
     Splits: []checkout.Split{
         split1, split2, split3,
     },
     MerchantAccount: "YOUR_MERCHANT_ACCOUNT",
     PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails),
     BillingAddress: &billingAddress,
   }

   // Send the request
   service := client.Checkout()
   req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest)
   res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)
   ```

   #### Python

   ```py
   # Adyen Python API Library v13.3.0
   import Adyen

   adyen = Adyen.Adyen()
   adyen.client.xapikey = "ADYEN_API_KEY"
   # For the LIVE environment, also include your liveEndpointUrlPrefix.
   adyen.client.platform = "test" # The environment to use library in.

   # Create the request object(s)
   json_request = {
     "paymentMethod": {
       "type": "scheme",
       "number": "4111111111111111",
       "cvc": "737",
       "expiryMonth": "03",
       "expiryYear": "2030",
       "holderName": "John Doe"
     },
     "billingAddress": {
       "city": "London",
       "country": "GB",
       "houseNumberOrName": "10",
       "postalCode": "SW1A 2AA",
       "street": "Downing Street"
     },
     "amount": {
       "value": 20174,
       "currency": "PLN"
     },
     "reference": "YOUR_PAYMENT_REFERENCE",
     "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
     "splits": [ {
       "type": "BalanceAccount",
       "account": "BA00000000000000000000001",
       "amount": {
         "currency": "CZK",
         "value": 100000
       },
       "reference": "YOUR_SPLIT_REFERENCE_1",
       "description": "YOUR_SPLIT_DESCRIPTION_1"
     }, {
       "type": "Remainder",
       "account": "BA00000000000000000000001",
       "reference": "YOUR_REMAINDER_REFERENCE",
       "description": "YOUR_REMAINDER_DESCRIPTION"
     }, {
       "type": "PaymentFee",
       "account": "BA00000000000000000000001",
       "reference": "YOUR_PAYMENT-FEE_REFERENCE",
       "description": "YOUR_PAYMENT-FEE_DESCRIPTION"
     } ]
   }

   # Send the request
   result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID")
   ```

   #### Ruby

   ```rb
   # Adyen Ruby API Library v10.1.1
   require "adyen-ruby-api-library"

   adyen = Adyen::Client.new
   adyen.api_key = 'ADYEN_API_KEY'
   # For the LIVE environment, also include your liveEndpointUrlPrefix.
   adyen.env = :test # Set to "live" for live environment

   # Create the request object(s)
   request_body = {
     :paymentMethod => {
       :type => 'scheme',
       :number => '4111111111111111',
       :cvc => '737',
       :expiryMonth => '03',
       :expiryYear => '2030',
       :holderName => 'John Doe'
     },
     :billingAddress => {
       :city => 'London',
       :country => 'GB',
       :houseNumberOrName => '10',
       :postalCode => 'SW1A 2AA',
       :street => 'Downing Street'
     },
     :amount => {
       :value => 20174,
       :currency => 'PLN'
     },
     :reference => 'YOUR_PAYMENT_REFERENCE',
     :merchantAccount => 'YOUR_MERCHANT_ACCOUNT',
     :splits => [ {
       :type => 'BalanceAccount',
       :account => 'BA00000000000000000000001',
       :amount => {
         :currency => 'CZK',
         :value => 100000
       },
       :reference => 'YOUR_SPLIT_REFERENCE_1',
       :description => 'YOUR_SPLIT_DESCRIPTION_1'
     }, {
       :type => 'Remainder',
       :account => 'BA00000000000000000000001',
       :reference => 'YOUR_REMAINDER_REFERENCE',
       :description => 'YOUR_REMAINDER_DESCRIPTION'
     }, {
       :type => 'PaymentFee',
       :account => 'BA00000000000000000000001',
       :reference => 'YOUR_PAYMENT-FEE_REFERENCE',
       :description => 'YOUR_PAYMENT-FEE_DESCRIPTION'
     } ]
   }

   # Send the request
   result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' })
   ```

   #### NodeJS (TypeScript)

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

   // For the LIVE environment, also include your liveEndpointUrlPrefix.
   const client = new Client({ apiKey: "ADYEN_API_KEY", environment: "TEST" });

   // Create the request object(s)
   const splitAmount1: Types.checkout.SplitAmount = {
     currency: "CZK",
     value: 100000
   };

   const amount: Types.checkout.Amount = {
     currency: "PLN",
     value: 20174
   };

   const split1: Types.checkout.Split = {
     reference: "YOUR_SPLIT_REFERENCE_1",
     amount: splitAmount1,
     description: "YOUR_SPLIT_DESCRIPTION_1",
     type: Types.checkout.Split.TypeEnum.BalanceAccount,
     account: "BA00000000000000000000001"
   };

   const split2: Types.checkout.Split = {
     reference: "YOUR_REMAINDER_REFERENCE",
     description: "YOUR_REMAINDER_DESCRIPTION",
     type: Types.checkout.Split.TypeEnum.Remainder,
     account: "BA00000000000000000000001"
   };

   const split3: Types.checkout.Split = {
     reference: "YOUR_PAYMENT-FEE_REFERENCE",
     description: "YOUR_PAYMENT-FEE_DESCRIPTION",
     type: Types.checkout.Split.TypeEnum.PaymentFee,
     account: "BA00000000000000000000001"
   };

   const cardDetails: Types.checkout.CardDetails = {
     number: "4111111111111111",
     cvc: "737",
     holderName: "John Doe",
     expiryMonth: "03",
     expiryYear: "2030",
     type: Types.checkout.CardDetails.TypeEnum.Scheme
   };

   const billingAddress: Types.checkout.BillingAddress = {
     country: "GB",
     city: "London",
     houseNumberOrName: "10",
     street: "Downing Street",
     postalCode: "SW1A 2AA"
   };

   const paymentRequest: Types.checkout.PaymentRequest = {
     reference: "YOUR_PAYMENT_REFERENCE",
     amount: amount,
     splits: [split1, split2, split3],
     merchantAccount: "YOUR_MERCHANT_ACCOUNT",
     paymentMethod: cardDetails,
     billingAddress: billingAddress
   };

   // Send the request
   const checkoutAPI = new CheckoutAPI(client);
   const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
   ```

3. You receive the following response:

   **Response**

   ```json
   {
      ...
      "pspReference":"LVP53Z9PQGNG5S82",
      "resultCode":"Authorised",
      "amount":{
         "currency":"PLN",
         "value":20174
      },
      "merchantReference":"YOUR_PAYMENT_REFERENCE",
      "paymentMethod":{
         "brand":"mc",
         "type":"scheme"
      }
   }
   ```

The splits are guaranteed, and the payment 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](/marketplaces/reports-and-fees/balance-platform-accounting-report).
