> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mangopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# View an indicative Conversion Rate

<Note>
  **Note – Rate is not guaranteed**

  The rate returned by the API is indicative of the rate offered by Mangopay, but it is not a guaranteed rate. For quoted conversions, the rate is guaranteed by the quote. For instant conversions, the rate is displayed in the response.
</Note>

<a href="/guides/fx" target="_blank">Learn more about FX</a> **→**

### Path parameters

<ParamField path="DebitedCurrency" type="string">
  **Allowed values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

  The sell currency (the currency of the debited wallet during a conversion).
</ParamField>

<ParamField path="CreditedCurrency" type="string">
  **Allowed values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

  The buy currency (the currency of the credited wallet during a conversion).
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200 - Response parameters" defaultOpen>
    <ResponseField name="DebitedCurrency" type="string">
      **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

      The sell currency (the currency of the debited wallet during a conversion).
    </ResponseField>

    <ResponseField name="CreditedCurrency" type="string">
      **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

      The buy currency (the currency of the credited wallet during a conversion).
    </ResponseField>

    <ResponseField name="ClientRate" type="float">
      Max. 7 decimal places

      The rate including Mangopay’s markup, indicative of the rate invoiced during the billing cycle: `ClientRate` = `MarketRate` \* (1 - markup). 

      The `ClientRate` fluctuates in line with the `MarketRate`.
    </ResponseField>

    <ResponseField name="MarketRate" type="float">
      Max. 7 decimal places

      The rate used to convert funds during a conversion: (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`.

      The market rate fluctuates in line with FX market dynamics and is common to all platforms for the currency pair.
    </ResponseField>

    <ResponseField name="MarketRateDate" type="Unix timestamp">
      The date and time at which the market rate was retrieved.
    </ResponseField>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="400 - FX feature not activated">
    ```json theme={null}
    {
        "Message": "Forex module is not enabled. Contact your support to activate this feature.",
        "Type": "forbidden_ressource",
        "Id": "51199cfd-d8ca-4f30-8262-955c1d2f97ec",
        "Date": 1699977915.0,
        "errors": null
    }  
    ```
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200 - EURGBP currency pair with markup of 100 basis points (1% or 0.01)   theme={null}
  {
      "DebitedCurrency": "EUR",
      "CreditedCurrency": "GBP",
      "ClientRate": 0.8315406,
      "MarketRate": 0.83994,
      "MarketRateDate": 1721742951
  }  
  ```
</ResponseExample>

<RequestExample>
  ```php PHP  theme={null}
  <?php 

  require_once '../vendor/autoload.php';

  use MangoPay\MangoPayApi;
  use MangoPay\Libraries\ResponseException as MGPResponseException;
  use MangoPay\Libraries\Exception as MGPException;

  $api = new MangoPayApi();

  $api->Config->ClientId = 'client-id';
  $api->Config->ClientPassword = 'api-key';
  $api->Config->TemporaryFolder = '../tmp/';
  $api->Config->DebugMode = false;

  try { 
      $response = $api->Conversions->GetConversionRate("EUR", "GBP");

      print_r($response);
  } catch(MGPResponseException $e) {
      print_r($e);
  } catch(MGPException $e) {
      print_r($e);
  }
  ```

  ```java Java   theme={null}
  import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  import com.mangopay.MangoPayApi;
  import com.mangopay.entities.ConversionRate;

  public class ViewConversionRate {
      public static void main(String[] args) throws Exception {
          MangoPayApi mangopay = new MangoPayApi();
          mangopay.getConfig().setClientId("your-client-id");
          mangopay.getConfig().setClientPassword("your-client-password");

          ConversionRate conversionRate = mangopay.getConversionsApi().getConversionRate("EUR", "GBP");

          Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
          String prettyJson = prettyPrint.toJson(conversionRate);

          System.out.println(prettyJson);
      }
  }
  ```

  ```csharp .NET  theme={null}
  using MangoPay.SDK;
  using Newtonsoft.Json;
  using MangoPay.SDK.Entities.GET;

  class Program
  {
      static async Task Main(string[] args)
      {
          MangoPayApi api = new MangoPayApi();

          api.Config.ClientId = "your-client-id";
          api.Config.ClientPassword = "your-api-key";

          ConversionRateDTO conversionRate = await api.Conversions.GetConversionRate("EUR", "GBP");

          string prettyPrint = JsonConvert.SerializeObject(conversionRate, Formatting.Indented);
          Console.WriteLine(prettyPrint);
  	}
  }
  ```
</RequestExample>
