計算轉換

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}
複製