GET
/
v2.01
/
{ClientId}
/
conversions
/
rate
/
{DebitedCurrency}
/
{CreditedCurrency}
<?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);
}
{
    "DebitedCurrency": "EUR",
    "CreditedCurrency": "GBP",
    "ClientRate": 0.8315406,
    "MarketRate": 0.83994,
    "MarketRateDate": 1721742951
}  

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.

Learn more about FX

Path parameters

DebitedCurrency
string

Allowed values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).

The sell currency (the currency of the debited wallet during a conversion).

CreditedCurrency
string

Allowed values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).

The buy currency (the currency of the credited wallet during a conversion).

Responses

{
    "DebitedCurrency": "EUR",
    "CreditedCurrency": "GBP",
    "ClientRate": 0.8315406,
    "MarketRate": 0.83994,
    "MarketRateDate": 1721742951
}  
<?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);
}