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​
| Name | Type | Required | Description |
|---|---|---|---|
from_currency | string | ✓ | Source currency code |
to_currency | string | ✓ | Target currency code |
from_amount | integer | Amount to convert from (in cents) | |
from_amount_decimal | string | Decimal amount to convert from | |
to_amount | integer | Target amount (in cents) | |
to_amount_decimal | string | Decimal target amount | |
account_number | string | Account 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_currencyREQUIREDSource currency code
to_currencyREQUIREDTarget currency code
from_amountAmount to convert from (in cents)
from_amount_decimalDecimal amount to convert from
to_amountTarget amount (in cents)
to_amount_decimalDecimal target amount
account_numberAccount 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"
}