# Steps 3-6: Exchange Rates

{% hint style="warning" %}
This step only applies to Source PSPs that wish to use a third-party FX Provider.\
\
Source PSPs that hold funds in an account as a Settlement Access Provider in the Destination Country can define their own FX rate. See [Payment setup for PSPs who provide their own FX](/payment-processing/payment-setup-for-psps-who-provide-their-own-fx.md) for detail.
{% endhint %}

As shown in [Step 2](/payment-setup/steps-1-2-country-currency-and-amount.md#toc116457913), the Sender can choose to set EITHER:

* the amount to send in their own Source Currency. This is the **`DebtorAccountAmount`** which will be debited from the Sender/Debtor's account, defined in the Source Currency, OR
* the amount the Recipient should receive, in the Recipient's own Destination Currency. This is the **`CreditorAccountAmount`** which will be credited to the Recipient/Creditor's account, defined in the Destination Currency

The quote request process is slightly different depending on which option the Sender chose.

## Step 3: Source PSP prepares quote request to Nexus <a href="#toc116457915" id="toc116457915"></a>

1. The Source PSP should use the `GET /quotes` API operation to retrieve quotes. This API accepts the following values:
   1. `Source Country`
   2. `Source Currency`
   3. `Destination Country`
   4. `Destination Currency`
   5. `Amount`
   6. `Amount Currency` (ie the 3-letter code for the Source Currency or Destination Currency)
2. If the Sender defined the `DebtorAccountAmount` (ie amount to send), then the Source PSP should set the following values in the quote request:
   1. `Amount Currency` = `Source Currency`
   2. `Amount` = `DebtorAccountAmount` **minus** `Source PSP Deducted Fee`

{% hint style="info" %}
If the Source PSP charges a *Source PSP Deducted Fee,* this fee is deducted from the `DebtorAccountAmount` *before* any funds are transfered to the FX Provider. Therefore the Source PSP should request the quote amount **after** deducting its own fee.

For further information on the *Source PSP Deducted Fee,* see [Fees](/payment-processing/fees.md#source-psp-fees)
{% endhint %}

3. Alternatively, if the Sender defined the `CreditorAccountAmount` (ie amount the recipient should receive), then the Source PSP should set the following values in the quote request:
   1. `Amount Currency` = `Destination Currency`
   2. `Amount` = `CreditorAccountAmount`

{% hint style="info" %}
In this case, the Source PSP should request the amount defined by the Sender ie the CreditorAccountAmount. This is the exact amount that should be credited to the Recipient/Creditor account.

Nexus will work backwards from the CreditorAccountAmountto calculate how much money (in the Source Currency) the Source PSP needs to transfer to the FXP. This amount will also be sufficient to cover the `Destination PSP Deducted Fee`, so that the Recipient receives the full CreditorAccountAmount. See [Fees](/payment-processing/fees.md#destination-psp-deducted-fee) for further detail.
{% endhint %}

4. The Source PSP sends a quote request to the `GET /quotes` API (see [APIs](/apis/overview.md)).

## Step 4: Nexus generates quotes <a href="#toc116457915" id="toc116457915"></a>

4. Nexus will retrieve the basic rates for the currency and country pair selected, from those FXPs that have confirmed they are happy to provide FX to this Source PSP
5. For each rate, **Nexus** will:
   1. automatically apply any improvements offered by that FXP based on size of the transaction or the PSP requesting the rate. (See [Improving rates for larger transactions](/fx-provision/rates-from-third-party-fx-providers/improving-rates-for-larger-transactions.md) and [Improving rates for specific PSPs](/fx-provision/rates-from-third-party-fx-providers/improving-rates-for-specific-psps.md) for more detail.)
   2. **If the Sender defined the `DebtorAccountAmount`**, the Source PSP will have subtracted their own Destination PSP Deducted Fee and then requested a quote for the net amount - the `Interbank Settlement Amount` in the Source Currency. Nexus will multiply this amount by the (possibly improved) exchange rate to get the amount that will be transferred from the Destination SAP to the Destination PSP (the `Interbank Settlement Amount` in Destination Currency).
      1. Nexus will also calculate the `Destination PSP Deducted Fee` and include this in the quote response.
      2. Nexus will calculate the amount that will be credited to the Recipient's account after the `Destination PSP (Deducted) Fee` has been deducted. This is included the quote response as `CreditorAccountAmount`.
   3. Alternatively, **if the Sender defined the `CreditorAccountAmount`**, Nexus will:
      1. work backwards from this amount to calculate the `Destination PSP (Deducted) Fee`.
      2. add the `CreditorAccountAmount` and `Destination PSP (Deducted) Fee` together, and divide the result by the (possibly improved) exchange rate to identify how much the Source PSP needs to transfer to the FXP. This amount will be included in the Quote response as `Interbank Settlement Amount` (in the Source Currency).
   4. Nexus will check that the `Interbank Settlement Amount` (in the Source Currency) and `CreditorAccountAmount` (at the given rate) do not exceed the `MaxAmount` values in either the Source or Destination IPS
      1. Where the Source Currency Amount or Destination Currency Amount provided by the Sender exceeds the `MaxAmt` of the respective IPS, Nexus will apply whichever cap is the smaller at the current rate, and include a flag `cappedToMaxAmount = true` in the quote response, which shows that the amount exceeded the cap. If this value is true, the `Interbank Settlement Amount` shown is the maximum that can successfully be sent through both IPSs at the current exchange rate.
6. Nexus will then return the full list of adjusted and improved rates, with `Quote Id`s that are unique to this `GET /quotes` request. (The Quote Id of the chosen quote must be referenced when the PSP submits the `pacs.008` payment instruction in [Step 13-16: Set up and send the payment instruction](/payment-setup/step-13-16-set-up-and-send-the-payment-instruction.md#toc116457927))

{% hint style="danger" %}
The `GET /quotes`API must be called again every time the Sender changes either the Source Currency Amount or Destination Currency Amount, since changes in the transaction value may (a) breach the maximum transaction value or (b) qualify for different size-based improvements to the rate.
{% endhint %}

## Step 5: Source PSP selects the preferred quote

1. The Source PSP selects the quote that the PSP wishes to use (from any FXP with which is has already onboarded). This could be the best quote available or a quote from a preferred FX Provider.
2. The PSP does not need to show the list of quotes to the Sender.

## Step 6: Source PSP displays the exchange rate and amounts to the Sender <a href="#toc116457916" id="toc116457916"></a>

Now the exchange rate and Source Currency Amount and Destination Currency Amount can be shown to the Sender:

* If the Sender defined the `DebtorAccountAmount` (ie the amount they wish to send, in their own currency), the amount fields should be updated as follows:
  * `DebtorAccountAmount` = the DebtorAccountAmount originally defined by the Sender (ie no change)
  * `CreditorAccountAmount` = the `CreditorAccountAmount` which was calculated by Nexus and provided in the Quote response;
* If the Sender defines the `CreditorAccountAmount` (ie the amount that the Sender wishes the Recipient to receive),
  * `DebtorAccountAmount` = the `Interbank Settlement Amount` (in Source Currency) provided in the quote response **plus** the *Source PSP (Deducted) Fee*
  * `CreditorAccountAmount` = the `CreditorAccountAmount` which was originally defined by the Sender. (This will be the same as the `CreditorAccountAmount` included the quote response.)

{% hint style="info" %}
The Source PSP should check the quote response to confirm whether the amount originally requested by the Sender exceeded the maximum amount in either the Source IPS or Destination IPS.

If so, the Source PSP should update the app screen to show the new maximum value that can be sent.
{% endhint %}

* The effective exchange rate applied should also be shown to the Sender


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nexusglobalpayments.org/payment-setup/steps-3-6-exchange-rates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
