Skip to main content
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 guaranteedThe 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

200 - Response parameters

DebitedCurrency
string
Returned 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
Returned 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).
ClientRate
float
Max. 7 decimal placesThe 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.
MarketRate
float
Max. 7 decimal placesThe 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.
MarketRateDate
Unix timestamp
The date and time at which the market rate was retrieved.
{
    "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
}  
{
    "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);
}
I