Skip to main content

Convert currency

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

Execute currency conversion in user's account.

Example: Convert EUR to 2.00 USD if price is no bigger than 1.50 EUR

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.

Request Body​

FieldTypeRequiredDescription
from_currencystring✓Source currency code
to_currencystring✓Target currency code
from_amountintegerAmount to convert (in cents)
from_amount_decimalstringDecimal amount to convert
to_amountintegerTarget amount (in cents)
to_amount_decimalstringTarget decimal amount
account_numberstring✓Account number for conversion
max_from_amountintegerMaximum source amount in cents
max_from_amount_decimalstringMaximum source decimal amount
min_to_amountintegerMinimum target amount in cents
min_to_amount_decimalstringMinimum target decimal amount

Example​

Request​

POST https://wallet.paysera.com/rest/v1/currency-conversion
Content-Type: application/json
Authorization: MAC id="CLIENT_ID", ts="TIMESTAMP", nonce="RANDOM_STRING", mac="MAC_HASH", ext="body_hash=BODY_HASH"
{
"from_currency": "EUR",
"to_currency": "USD",
"to_amount": 200,
"account_number": "EVP0010001000101",
"max_from_amount": 150
}

Response​

{
"id": 11221,
"date": 1391686980,
"from_currency": "EUR",
"to_currency": "USD",
"from_amount": 150,
"from_amount_decimal": "1.50",
"to_amount": 200,
"to_amount_decimal": "2.00",
"account_number": "EVP0010001000101"
}

AUTHORIZATION: HTTP

REQUEST

Base URL
https://wallet.paysera.com
Body REQUIRED
{
"from_currency": "EUR",
"to_currency": "USD",
"to_amount": 200,
"account_number": "EVP0010001000101",
"max_from_amount": 150
}

RESPONSE

Conversion successful
{
"id": 11221,
"date": 1391686980,
"from_currency": "EUR",
"to_currency": "USD",
"from_amount": 150,
"from_amount_decimal": "1.50",
"to_amount": 200,
"to_amount_decimal": "2.00",
"account_number": "EVP0010001000101"
}