Get Conversion Rates

Definition

https://sandbox.bluesnap.com/services/2/tools/currency-rates?base-currency={currency code}"e-currency={currency code}


Documentation

The Get Conversion Rates service enables you to obtain currency conversion rates. You can get all conversion rates with USD as the base currency, or specify a base currency and/or quote currency.

When using this tool, it is recommended to set the base currency to the base currency of your store in BlueSnap.

JSON Request Content

Enter the base-currency and/or quote-currency parameters into the web service URL.

For example:
/services/2/tools/currency-rates?base-currency=EUR&quote-currency=JPY

JSON Response Details

If successful, the response HTTP status code is 200 OK.
The response body contains the conversion rates from the base currency to the quote currency.

If the request contained an invalid currency code, the PRICING_CURRENCY_NOT_FOUND (13001) error is returned.


JSON Examples

Request Examples

curl -v -X GET https://sandbox.bluesnap.com/services/2/tools/currency-rates?base-currency=EUR&quote-currency=JPY  \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
curl -v -X GET https://sandbox.bluesnap.com/services/2/tools/currency-rates \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='

Response Examples

{
  "baseCurrency": "EUR",
  "currencyRate": [
    {
      "quoteCurrency": "JPY",
      "conversionRate": 155.454939
    }
  ]
}
{
  "baseCurrency": "USD",
  "currencyRate": [
    {
      "quoteCurrency": "EUR",
      "conversionRate": 0.776349
    },
    {
      "quoteCurrency": "GBP",
      "conversionRate": 0.628543
    },
    {
      "quoteCurrency": "CAD",
      "conversionRate": 1.1531
    },
    ...
  ]
}

XML Request Content

Enter the base-currency and/or quote-currency parameters into the web service URL.

For example:
/services/2/tools/currency-rates?base-currency=EUR&quote-currency=JPY

XML Response Details

If successful, the response HTTP status code is 200 OK.
The response body contains the conversion rates from the base currency to the quote currency.

If the request contained an invalid currency code, the PRICING_CURRENCY_NOT_FOUND (13001) error is returned.


XML Examples

Request Examples

curl -v -X GET https://sandbox.bluesnap.com/services/2/tools/currency-rates?base-currency=EUR&quote-currency=JPY  \
-H 'Accept: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
curl -v -X GET https://sandbox.bluesnap.com/services/2/tools/currency-rates \
-H 'Accept: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='

Response Examples

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<currency-rates 
    xmlns="http://ws.plimus.com">
    <base-currency>EUR</base-currency>
    <currency-rate>
        <quote-currency>JPY</quote-currency>
        <conversion-rate>141.357520</conversion-rate>
    </currency-rate>
</currency-rates>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<currency-rates xmlns="http://ws.plimus.com">
    <base-currency>USD</base-currency>
    <currency-rate>
        <quote-currency>EUR</quote-currency>
        <conversion-rate>0.727209</conversion-rate>
    </currency-rate>
    <currency-rate>
        <quote-currency>GBP</quote-currency>
        <conversion-rate>0.639039</conversion-rate>
    </currency-rate>
    <currency-rate>
        <quote-currency>CAD</quote-currency>
        <conversion-rate>1.14171</conversion-rate>
    </currency-rate>
   ...
</currency-rates>

Back to Top

Language
Credentials
:
Click Try It! to start a request and see the response here!