跳至主要内容

創建訂單

信息
  • API 金鑰需要具備 Earn(理財)權限。
  • 訂單採非同步處理。響應成功僅代表訂單已被接受,而非已結算。請使用查詢訂單資訊追蹤訂單狀態。
  • orderLinkId 用於保證冪等性——重複提交相同的 orderLinkId 時,系統將返回訂單已存在的錯誤。
  • 下單前必須先呼叫查詢產品報價,並將返回的報價參數傳入 discountBuyExtra
  • 僅支援普通 DiscountBuy 產品。 超級折扣購(Ultra Discount Buy)及利息卡(Interest Card)產品不支援此 API。

HTTP 請求

POST/v5/earn/advance/place-order

請求參數

參數必填類型說明
categorytruestring產品類別,DiscountBuy
productIdtruestring產品 ID
orderTypetruestring固定值:Stake
amounttruestring投資金額(USDT),精度由查詢產品資訊中的 orderPrecisionDigital 決定
cointruestring投資幣種,USDT
accountTypetruestring扣款帳戶:FUND(資金帳戶)或 UNIFIED(統一交易帳戶)
orderLinkIdtruestring用戶自定義訂單 ID,用於冪等性控制。最多 40 個字元,僅支援字母、數字及 _
discountBuyExtratrueObject折扣購報價參數
> initialPricetruestring下單時標的資產的當前市場價格,建議使用查詢產品報價中的 currentPrice,最多 8 位小數
> purchasePricetruestring來自查詢產品報價的錨定買入價,最多 8 位小數
> knockoutPricetruestring來自查詢產品報價的敲出價,最多 8 位小數
> knockoutCouponE8truestring來自查詢產品報價的年化息率(e8 精度)
> settleTypetruestring行權結算方式:Base = 收取標的資產(數量 = amount / purchasePrice);Quote = 收取 USDT(金額 = amount / purchasePrice × settlementPrice)。敲出時此參數無效,無論傳何值均返還 USDT 本金 + 利息
> instUidtruestring來自查詢產品報價的做市商機構 ID

響應參數

參數類型說明
orderIdstring系統生成的訂單 ID
orderLinkIdstring用戶自定義訂單 ID(原樣返回)

請求示例

POST /v5/earn/advance/place-order HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1776154116919
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"category": "DiscountBuy",
"productId": "7037",
"orderType": "Stake",
"amount": "200",
"coin": "USDT",
"accountType": "FUND",
"orderLinkId": "my-order-001",
"discountBuyExtra": {
"initialPrice": "74571.32",
"purchasePrice": "74019",
"knockoutPrice": "76050",
"knockoutCouponE8": "1000000",
"settleType": "Base",
"instUid": "100307526"
}
}

響應示例

{
"retCode": 0,
"retMsg": "",
"result": {
"orderId": "38f6f5ce-57e2-4d69-b4d3-c39464389ccb",
"orderLinkId": "my-order-001"
},
"retExtInfo": {},
"time": 1776154116919
}