计算转换

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

要求

查询参数

姓名参数类型定义
from*stringmax:10源货币
to*stringmax:10要在源货币中计算的金额
from_amount*stringrequired_without: to_amount要在源货币中计算的金额
to_amount*stringrequired_without: from_amount要在目标货币中计算的金额

参数类型

stringmax:10

定义

源货币

参数类型

stringmax:10

定义

要在源货币中计算的金额

参数类型

stringrequired_without: to_amount

定义

要在源货币中计算的金额

参数类型

stringrequired_without: from_amount

定义

要在目标货币中计算的金额

* - 强制性参数

请求示例

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"
    }'
复制

回复

响应参数

姓名定义
from金额从
approximate_rate汇率
commission佣金
total_amount总金额
to金额到

定义

金额从

定义

汇率

定义

佣金

定义

总金额

定义

金额到

响应示例


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}
复制