Returns currency conversion rates. You can get all conversion rates with USD as the base currency, or specify a base currency.
When using this tool, we recommend that you set the base currency to the base currency of your store in BlueSnap.
Endpoint
https://sandbox.bluesnap.com/services/2/tools/currency-rates?base-currency={currency_code}"e-currency={currency_code}
Request Content
No content is required in the request body. Enter the relevant information in the request URL with query string parameters:
/services/2/tools/currency-rates?base-currency={currency_code}&e-currency={currency_code}
For example:
/services/2/tools/currency-rates?base-currency=EUR&e-currency=JPY
Query String Parameters
Parameter | Type | Required | Description |
---|---|---|---|
base-currency | string | optional | Three-letter currency code of the currency that you are converting from. Default: USD |
quote-currency | string | required | Three-letter currency code of the currency that you want to convert to. |
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.
Errors
If the request contained an invalid currency code, the PRICING_CURRENCY_NOT_FOUND
(13001) error is returned.
Examples
JSON
Request Examples
curl -v -X GET https://sandbox.bluesnap.com/services/2/tools/currency-rates?base-currency=EUR"e-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 Examples
curl -v -X GET https://sandbox.bluesnap.com/services/2/tools/currency-rates?base-currency=EUR"e-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>