Skip to main content

Calculate currency conversion

GET https://wallet.paysera.com/rest/v1/currency-conversion

Calculate probable result of currency conversion.

Example queries:

  • Calculate needed price: GET /currency-conversion?from_currency=EUR&to_currency=USD&to_amount=200
  • Calculate result: GET /currency-conversion?from_currency=EUR&to_currency=USD&from_amount=150

Note: Rates can change, so the result is not guaranteed when actual conversion takes place.

Authorization​

This endpoint requires MAC (Message Authentication Code) authentication.

Authorization Header Format:

Authorization: MAC id="CLIENT_ID", ts="TIMESTAMP", nonce="RANDOM_STRING", mac="MAC_HASH", ext="body_hash=BODY_HASH"

Example:

Authorization: MAC id="a9b8c7d6e5f4g3h2", ts="1234567890", nonce="xyz123abc456def", mac="dGhpcyBpcyBhIHJhbmRvbSBtYWMgaGFzaCB2YWx1ZQ==", ext="body_hash=cmFuZG9tQm9keUhhc2hWYWx1ZQ%3D%3D"

For more details, see the Authentication section.

Parameters​

Query Parameters​

NameTypeRequiredDescription
from_currencystring✓Source currency code
to_currencystring✓Target currency code
from_amountintegerAmount to convert from (in cents)
from_amount_decimalstringDecimal amount to convert from
to_amountintegerTarget amount (in cents)
to_amount_decimalstringDecimal target amount
account_numberstringAccount number for conversion

Example​

Request​

GET https://wallet.paysera.com/rest/v1/currency-conversion?from_currency=EUR&to_currency=USD&from_amount=150&from_amount_decimal=value&to_amount=200&to_amount_decimal=value&account_number=value
Authorization: MAC id="CLIENT_ID", ts="TIMESTAMP", nonce="RANDOM_STRING", mac="MAC_HASH"

Response​

{
"from_currency": "EUR",
"to_currency": "USD",
"from_amount": 10000,
"from_amount_decimal": "100.00",
"to_amount": 11050,
"to_amount_decimal": "110.50"
}

AUTHORIZATION: HTTP

REQUEST

Base URL
https://wallet.paysera.com
Query Parameters
from_currencyREQUIRED
Source currency code
to_currencyREQUIRED
Target currency code
from_amount
Amount to convert from (in cents)
from_amount_decimal
Decimal amount to convert from
to_amount
Target amount (in cents)
to_amount_decimal
Decimal target amount
account_number
Account number for conversion

RESPONSE

Conversion calculation successful
{
"from_currency": "EUR",
"to_currency": "USD",
"from_amount": 10000,
"from_amount_decimal": "100.00",
"to_amount": 11050,
"to_amount_decimal": "110.50"
}