---
title: "setExchangeRates"
slug: "api/basket/operations/setexchangerates"
sidebar:
  order: 499
---

<a id="ref-097a67708891"></a>
<a id="ref-fa59a5eb5621"></a>
<a id="ref-89c789c63092"></a>

```text
void setExchangeRates(SessionId sessionId,
    ExchangeRate[]      exchangeRates,
    string?           referenceCurrency)
throws BasketServiceFault;
```

See also: [`v`](/pCon/configuratorOnline/specs/api/basket/types/exchangerate#ref-1a702957df21), [`SessionId`](/pCon/configuratorOnline/specs/api/session/types/sessionid#ref-02e397c8fdb4), [`ExchangeRate`](/pCon/configuratorOnline/specs/api/basket/types/exchangerate#ref-1a702957df21), [`BasketServiceFault`](/pCon/configuratorOnline/specs/api/basket/faults/basketservicefault#ref-d5adb74faa1b)

Operation to set zero or more exchange rates.

For each specified instance of [`ExchangeRate`](/pCon/configuratorOnline/specs/api/basket/types/exchangerate), the attribute `currency` must be an ISO 4217 currency code known to the currency converter, and the attribute `rate` must be present and specify a number greater than zero. If the currency is equal to the reference currency, the rate must be 1.0.

If the operation terminates normally, all exchange rates have been updated as specified. Otherwise, if the operation terminates abnormally with a [`BasketServiceFault`](/pCon/configuratorOnline/specs/api/basket/faults/basketservicefault), no exchange rates have been modified. Otherwise (abnormal termination with another fault) the behavior is undefined.

If argument `referenceCurrency` is present and contains a non-empty string, it must be one of the ISO 4217 currency codes returned by operation [`getExchangeRates`](/pCon/configuratorOnline/specs/api/basket/operations/getexchangerates). If so, it is set as the new reference currency, the conversion rate of this new reference currency is set to 1.0, and the conversion rates of all other currencies are updated to reflect the new reference currency.

New exchange rates specified by parameter `exchangeRates` will be set after the reference currency has been changed.

The implementation attempts to make sure that changing reference currency and exchange rates in one operation is atomic.

Note that changing the reference currency, and changing it back to the original reference currency, may result in slightly different conversion rates due to rounding of (intermediate) exchange rates to at most six significant digits.
