跳至主要内容

申請報價

HTTP 請求

POST /v5/asset/exchange/quote-apply

請求參數

參數是否必需類型說明
fromCointruestring兌出幣種
toCointruestring兌入幣種
fromCoinTypefalsestringcrypto
toCoinTypefalsestringcrypto
requestCointruestring請求報價幣種, 和兌出幣種保持一致
  • 未來, 可能會支援requestCoin=兌入幣種
  • requestAmounttruestring請求報價幣種數量
    accountTypetruestring帳戶類型
    paramTypefalsestringopFrom, 主要用於API broker
    paramValuefalsestringBroker ID, 主要用於API broker
    requestIdfalsestring自定義的請求ID
  • 最長不超過36位的字符串
  • 一般來說該字段無用, 可用於內部追蹤這次報價請求
  • 響應參數

    參數類型說明
    quoteTxIdstring報價單號. 由系統生成, 用於後面的確認報價和查詢
    exchangeRatestring兌換率
    fromCoinstring兌出幣種
    fromCoinTypestring兌出幣種類型. crypto
    toCoinstring兌入幣種
    toCoinTypestring兌入幣種類型. crypto
    fromAmountstring兌出幣種數量
    toAmountstring兌入幣種數量
    expiredTimestring報價單過期的時間戳(有效期為15秒)
    requestIdstring自定義請求ID

    請求示例

    POST /v5/asset/exchange/quote-apply HTTP/1.1
    Host: api-testnet.bybit.com
    X-BAPI-API-KEY: XXXXXX
    X-BAPI-TIMESTAMP: 1720071077014
    X-BAPI-RECV-WINDOW: 5000
    X-BAPI-SIGN: XXXXXX
    Content-Type: application/json
    Content-Length: 172

    {
    "requestId": "test-00002",
    "fromCoin": "ETH",
    "toCoin": "BTC",
    "accountType": "eb_convert_funding",
    "requestCoin": "ETH",
    "requestAmount": "0.1",
    "paramType": "opFrom",
    "paramValue": "broker-id-001"
    }

    響應示例

    {
    "retCode": 0,
    "retMsg": "ok",
    "result": {
    "quoteTxId": "10100108106409340067234418688",
    "exchangeRate": "0.053517914861880000",
    "fromCoin": "ETH",
    "fromCoinType": "crypto",
    "toCoin": "BTC",
    "toCoinType": "crypto",
    "fromAmount": "0.1",
    "toAmount": "0.005351791486188000",
    "expiredTime": "1720071092225",
    "requestId": "test-00002"
    },
    "retExtInfo": {},
    "time": 1720071077265
    }