計算轉換
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}
複製