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. |
| API credentials | You must have credentials for the following APIs: Checkout API (format: ws@Company.[YourCompanyAccount]) Foreign Exchange API (format: ws@BalancePlatform.[YourBalancePlatform]). |
| API credential roles | To use the Foreign Exchange API, make sure you have the following role: Read FX rates role |
| Webhooks | Ensure that your server can receive and accept standard webhooks. Subscribe to any of the following webhooks: Transfer webhooks Transaction webhooks |
| Capabilities | Make sure that your account holders have the following capabilities: receivePayments receiveFromPlatformPayments sendToTransferInstrument |
| Setup steps | Before you begin: Ask our Support Team to: Enable the use of the Foreign Exchange API 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:- You calculate the amount your user receives in the settlement currency using the Foreign Exchange API.
- You make a POST
/paymentsrequest, specifying the cost of the goods in both currencies. - 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):-
Contact our Support Team to:
- Enable the use of the Foreign Exchange API for your merchant account.
- Configure the required currencies for your merchant account.
- Make sure that you have the API key for the Foreign Exchange API. Your credential has the format ws@BalancePlatform.[YourBalancePlatform].
-
Make 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:
Parameter Required Description type Set to splitPayment sourceAmount.currency The processing currency. sourceAmount.value The cost of the goods in the processing currency, in minor units. targetCurrency The settlement currency. exchangeSide The operation performed on the fixed currency (the currency provided in the sourceAmount.currencyfield. Set this to sell. -
In the response, note the following fields:
**
Parameter Description type Returns splitPayment exchangeSide The operation performed on the fixed currency (the currency provided in the sourceAmount.currencyfield). Returns sell.sourceAmount.currency The processing currency. sourceAmount.value The cost of the goods in the processing currency, in minor units. targetAmount.currency The settlement currency. targetAmount.value The cost of the goods in the settlement currency, in minor units. This is the amount your user receives. 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.
You receive the following response: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" } ] }'The 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.{ "exchangeCalculations": [ { "type": "splitPayment", "exchangeSide": "sell", "sourceAmount": { "currency": "PLN", "value": 20000 }, "targetAmount": { "currency": "CZK", "value": "1015.31" }, "appliedExchangeRate": "5.07655" } ] }
Send a payment request with the calculated amount
- Make sure that you have the API key for the Checkout API. Your credential has the format ws@Company.[YourCompanyAccount].
-
Send a POST /payments, /sessions, or /payments/{paymentPspReference}/captures request, specifying the following fields for the currency conversion:
Payment request with currency conversion
Parameter Required Description Example amount.valueThe cost of the goods in the processing currency, calculated in step 1. amount.value: 20000 amount.currencyThe currency in which the customer pays. amount.currency: “PLN” splits.amount.valueThe 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.currencyThe settlement currency. This is the currency in which your user receives the funds. splits.amount.currency: “CZK” splits.typeThe type of the split item. We recommend to always add a split item for the Remainder and the transaction fees. split.type: BalanceAccount split.type: PaymentFee split.type: Remainder curl
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
// 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 // 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#
// 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)
// 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
// 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
# 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
# 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)
// 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" }); -
You receive the following response:
Response
{ ... "pspReference":"LVP53Z9PQGNG5S82", "resultCode":"Authorised", "amount":{ "currency":"PLN", "value":20174 }, "merchantReference":"YOUR_PAYMENT_REFERENCE", "paymentMethod":{ "brand":"mc", "type":"scheme" } }