Calculate convert

post https://api.cryptomus.com/v2/user-api/convert/calculate Copy

Request

Query parameters

NameParameter typeDefinition
from*stringmax:10Currency From
to*stringmax:10Amount to be calculated in Currency From
from_amount*stringrequired_without: to_amountAmount to be calculated in Currency From
to_amount*stringrequired_without: from_amountAmount to be calculated in Currency To

Parameter type

stringmax:10

Definition

Currency From

Parameter type

stringmax:10

Definition

Amount to be calculated in Currency From

Parameter type

stringrequired_without: to_amount

Definition

Amount to be calculated in Currency From

Parameter type

stringrequired_without: from_amount

Definition

Amount to be calculated in Currency To

* - mandatory parameter

Request example

curl https://api.cryptomus.com/v2/user-api/convert/calculate \
    -X POST \
    -H 'userId: 8b03432e-385b-4670-8d06-064591096795' \
    -H 'sign: fe99035f86fa436181717b302b95bacff1' \
    -H 'Content-Type: application/json' \
    -d '{
        "from": "BTC",
        "to": "USDT",
        "from_amount": "0.0001"
    }'
Copy

Response

Response parameters

NameParameter typeDefinition
fromstringAmount from
approximate_ratestringConvert courseReturned depending on convert version
commissionstringCommission
total_amountstringTotal amount
tostringAmount to

Parameter type

string

Definition

Amount from

Parameter type

string

Definition

Convert courseReturned depending on convert version

Parameter type

string

Definition

Commission

Parameter type

string

Definition

Total amount

Parameter type

string

Definition

Amount to

Response example


1{
2  "state": 0,
3  "result": {
4    "from": "0.001",
5    "approximate_rate": "57853.000",
6    "commission": "3",
7    "total_amount": "60.000",
8    "to": "60.000"
9  }
10}
Copy