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.

Requirements​

  • Scope CLIENT_CONVERT_CURRENCY needs to be granted to the client by Paysera. Request Paysera to provide it.

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
user_idstringUser identifier for the conversion

Note: from_currency and to_currency must differ. Exactly one side (from/to) may be specified — the other is calculated — and each side accepts either its integer (cents) or decimal variant, not both.

Example​

Request​

GET https://wallet.paysera.com/rest/v1/currency-conversion?from_currency=EUR&to_currency=USD&from_amount=10000
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
user_id
User identifier for the 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"
}