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/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

NameDefinition
fromAmount from
approximate_rateConvert course
commissionCommission
total_amountTotal amount
toAmount to

Definition

Amount from

Definition

Convert course

Definition

Commission

Definition

Total amount

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