建立市價單

post
https://api.cryptomus.com/v2/user-api/convert/
複製

要求

查詢參數

姓名參數類型定義
from*stringmax:10轉換貨幣
to*stringmax:10要轉換的貨幣
amount*string需要兌換成貨幣的金額如果金額中有便士,則使用分隔符號“.”發送。
例如:10.28

參數類型

stringmax:10

定義

轉換貨幣

參數類型

stringmax:10

定義

要轉換的貨幣

參數類型

string

定義

需要兌換成貨幣的金額如果金額中有便士,則使用分隔符號“.”發送。
例如:10.28

* - 必需參數

請求範例

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

回覆

響應參數

姓名定義
order_id轉換ID
convert_amount_from轉換金額從
convert_amount_to將金額轉換為
executed_amount_to已執行金額
executed_amount_from執行金額來自
convert_currency_from貨幣轉換自
convert_currency_to將貨幣轉換為
type類型枚舉可用選項:marketlimit
status狀態枚舉可用選項:activecompletedpartially_completedcancelledexpiredfailed
created_at日期時間創建
current_rate目前利率
limit限制值(僅限限制類型)
expires_at限製到期日時間
completed_at訂單完成的日期時間(僅限訂單完成時)

定義

轉換ID

定義

轉換金額從

定義

將金額轉換為

定義

已執行金額

定義

執行金額來自

定義

貨幣轉換自

定義

將貨幣轉換為

定義

類型枚舉可用選項:- market- limit

定義

狀態枚舉可用選項:- active- completed- partially_completed- cancelled- expired- failed

定義

日期時間創建

定義

目前利率

定義

限制值(僅限限制類型)

定義

限製到期日時間

定義

訂單完成的日期時間(僅限訂單完成時)

回應範例


1{
2  "state": 0,
3  "result": {
4    "order_id": "2d9bf426-98ef-448b-84c2-03cc1ec78feb",
5    "convert_amount_from": "10.000",
6    "convert_amount_to": "3.000",
7    "executed_amount_from": null,
8    "executed_amount_to": null,
9    "convert_currency_from": "USDT",
10    "convert_currency_to": "XMR",
11    "type": "market",
12    "status": "completed",
13    "created_at": "2024-07-11 , 18:06:04",
14    "current_rate": "100",
15    "completed_at": "2024-07-11 , 18:06:04"
16  }
17}
複製