Bitget APIBitget API
UTAClassic
Legacy Doc
  • Overview
  • API Documentation
  • WebSocket
  • Agent Hub
  • SDK
  • Changelog
Copied to clipboard
API Document
Classic Account
    Futures · Trade
      Place OrderpostReversalpostBatch OrderpostModify OrderpostCancel OrderpostBatch CancelpostFlash Close PositionpostGet Order DetailgetGet Order Fill DetailsgetGet Historical Transaction DetailsgetGet Pending OrdersgetGet History OrdergetCancel All Orderspost
Classic Contract Trade API
Classic Contract Trade API

Futures · Trade

Classic Account — Futures · Trade


Place Order

POST
https://api.bitget.com
/api/v2/mix/order/place-order

Rate limit: 10 requests/second/UID

Ignore the tradeSide parameter when position mode is in one-way-mode In “hedge-mode”, when there is limit close order occupying the position, if the size of next market close order and limit close orders exceeds the position size, it will return an “insufficient position error” instead of cancelling the current limit order and executing the market order hedge position mode: Open long: "side"=buy, "tradeSide"=open; Close long: "side"=buy, "tradeSide"=close; Open short: "side"=sell, "tradeSide"=open; Close short: "side"=sell, "tradeSide"=close; one-way position mode: "side"=buy and sell, tradeSide: ignore In one-way-mode position mode, if the total size of the new reduce-only order and the existing reduce-only orders exceeds the position size, the system will cancel the existing reduce-only orders sequentially based on their creation order until the total size of the new and existing reduce-only orders is less than or equal to the position size. Additionally, the response for the latest reduce-only order request will not include an orderId. You can use the clientOid set in the request to query order details or retrieve the orderId from the current pending orders. When in hedge Mode, if a limit close order is occupying a position, and a subsequent market close order (its quantity plus the limit order's quantity) exceeds the total position size, it will not report an insufficient position error. It also won't cancel the limit order that's occupying the position. Instead, the quantity of the limit close order will be preserved, and the market order will close only the quantity remaining after subtracting the limit order's quantity from the total position size. For example: If you have a position of 100, a limit order occupies 70, and you then place a market close order for 50, it will not report an insufficient position error, nor will it cancel the occupying limit order to execute the market order. Instead, it will directly close a quantity of 30. When in hedge Mode,if the existing quantity is equal to the limit close position order of the held position, a newly added close position order will automatically cancel the limit order that has occupied the position. For elite traders, please strictly adhere to the list of trading pairs specified in the Available trading pairs and parameters for elite traders when placing orders using the Copy Trading API Key. Trading pairs outside the announced list are not available for copy trading. API Broker rebate identifier:

The following code block needs to be added to the HTTP Header of the request.

"X-CHANNEL-API-CODE":"your-channel-api-code"

Place Order › Request Parameters

symbol
​string · required

Trading pair, e.g. ETHUSDT

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures

marginMode
​string · required

Position mode isolated: isolated margin crossed: crossed margin

marginCoin
​string · required

Margin coin(capitalized)

size
​string · required

Amount (base coin) To get the decimal places of size:Get Contract Config

side
​string · required

Trade side buy: Buy(one-way-mode); Long position direction(hedge-mode) sell: Sell(one-way-mode); Short position direction(hedge-mode)

orderType
​string · required

Order type limit: limit orders market: market orders

price
​string

Price of the order. Required if the "orderType" is limit To get the decimal places of size:Get Contract Config

tradeSide
​string

Trade type Only required in hedge-mode open: Open position close: Close position

force
​string

Order expiration date. Required if the orderType is limit ioc: Immediate or cancel fok: Fill or kill gtc: Good till canceled(default value) post_only: Post only

clientOid
​string

Customize order ID

reduceOnly
​string

Whether or not to just reduce the position: YES, NO Default: NO. Applicable only in one-way-position mode

presetStopSurplusPrice
​string

Take-profit value No take-profit is set if the field is empty.

presetStopLossPrice
​string

Stop-loss value No stop-loss is set if the field is empty.

presetStopSurplusExecutePrice
​string

Preset stop - profit execution price.

presetStopLossExecutePrice
​string

Preset stop-loss execution price.

stpMode
​string

STP Mode(Self Trade Prevention) none: not setting STP(default value) cancel_taker: cancel taker order cancel_maker: cancel maker order cancel_both: cancel both of taker and maker orders

Place Order › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
orderId
​string

Order ID

clientOid
​string

Customize order ID

POST/api/v2/mix/order/place-order
curl https://api.bitget.com/api/v2/mix/order/place-order \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "symbol": "symbol", "productType": "productType", "marginMode": "marginMode", "marginCoin": "marginCoin", "size": "size", "price": "price", "side": "side", "tradeSide": "tradeSide", "orderType": "orderType", "force": "force", "clientOid": "clientOid", "reduceOnly": "reduceOnly", "presetStopSurplusPrice": "presetStopSurplusPrice", "presetStopLossPrice": "presetStopLossPrice", "presetStopSurplusExecutePrice": "presetStopSurplusExecutePrice", "presetStopLossExecutePrice": "presetStopLossExecutePrice", "stpMode": "stpMode" }'
Example Request Body
{ "symbol": "symbol", "productType": "productType", "marginMode": "marginMode", "marginCoin": "marginCoin", "size": "size", "price": "price", "side": "side", "tradeSide": "tradeSide", "orderType": "orderType", "force": "force", "clientOid": "clientOid", "reduceOnly": "reduceOnly", "presetStopSurplusPrice": "presetStopSurplusPrice", "presetStopLossPrice": "presetStopLossPrice", "presetStopSurplusExecutePrice": "presetStopSurplusExecutePrice", "presetStopLossExecutePrice": "presetStopLossExecutePrice", "stpMode": "stpMode" }
json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1695806875837, "data": { "clientOid": "121211212122", "orderId": "121211212122" } }
json
application/json

Reversal

POST
https://api.bitget.com
/api/v2/mix/order/click-backhand

Rate limit: 10 req/sec/UID Rate limit: 1 req/sec/UID for copy trading traders

side and tradeSide: - In one-way-mode, do NOT add the tradeSide parameter in request - In hedge-mode, tradeSide is required - Reversal the current long position and open a short position: side=buy, tradeSide - Reversal the current short position and open a long position: side=sell, tradeSide size: represents the reversal size - In one-way-mode, the whole position will be reversed if no size was set in the request - In hedge-mode: - If the size set is less than the current position size, the size of position will be closed and the same size reversal position will be opened For example, for a ETHUSDT size 20 long position, if the size was set 3 in request, then the current long position size will be reduced to 17, and a new size 3 short position will be opened - If the size set is equal to or more than the current position size, the whole position will be reversed For example, for a ETHUSDT size 10 long position, if the size was set 10 or 11 in request, then the current position will be closed and a new 10 size short position will be opened

API Broker rebate identifier:

The following code block needs to be added to the HTTP Header of the request.

"X-CHANNEL-API-CODE":"your-channel-api-code"

Reversal › Request Parameters

symbol
​string · required

Trading pair, e.g. ETHUSDT

marginCoin
​string · required

marginCoin e.g: USDT

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures

side
​string · required

Order direction buy: Buy sell: Sell

size
​string

Amount

tradeSide
​string

Direction Required in open and close (hedge mode) position . For one-way positions, this field will be ignored Open and Close Notes: For open long, fill in"Buy"; tradeSide should be "Open" For open short, fill in "Sell"; tradeSide should be "Open" For close long, fill in "Buy"; tradeSide should be "Close" For close short, fill in "Sell"; tradeSide should be "Close"

clientOid
​string

Customize order ID

Reversal › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
orderId
​string

Order ID

clientOid
​string

Customize order ID

POST/api/v2/mix/order/click-backhand
curl https://api.bitget.com/api/v2/mix/order/click-backhand \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "symbol": "symbol", "marginCoin": "marginCoin", "productType": "productType", "size": "size", "side": "side", "tradeSide": "tradeSide", "clientOid": "clientOid" }'
Example Request Body
{ "symbol": "symbol", "marginCoin": "marginCoin", "productType": "productType", "size": "size", "side": "side", "tradeSide": "tradeSide", "clientOid": "clientOid" }
json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1695806875837, "data": { "clientOid": "121211212122", "orderId": "1" } }
json
application/json

Batch Order

POST
https://api.bitget.com
/api/v2/mix/order/batch-place-order

Rate limit: 5 requests/second/UID Rate limit: 1 request/second/UID for copy trading traders

Supports TP/SL feature. If the current underlying asset does not exist in the position, it is intended to preset the TP/SL. If the current underlying exists in the position, it is intended to modify the TP/SL Ignore the tradeSide parameter when position mode is in one-way-mode API Broker rebate identifier:

The following code block needs to be added to the HTTP Header of the request.

"X-CHANNEL-API-CODE":"your-channel-api-code"

Batch Order › Request Parameters

symbol
​string · required

Trading pair

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures

marginCoin
​string · required

Margin coin, must be capitalized

marginMode
​string · required

Position mode isolated: isolated margin crossed: crossed margin

​object[] · required

Order list, maximum length: 50

Batch Order › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
​object[]

Successful order list

​object[]

Failed order list

result
​boolean

Whether all orders succeeded. true: all succeeded; false: at least one failed

POST/api/v2/mix/order/batch-place-order
curl https://api.bitget.com/api/v2/mix/order/batch-place-order \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "symbol": "symbol", "productType": "productType", "marginCoin": "marginCoin", "marginMode": "marginMode", "orderList": [ { "size": "size", "price": "price", "side": "side", "tradeSide": "tradeSide", "orderType": "orderType", "force": "force", "clientOid": "clientOid", "reduceOnly": "reduceOnly", "presetStopSurplusPrice": "presetStopSurplusPrice", "presetStopLossPrice": "presetStopLossPrice", "stpMode": "stpMode" } ] }'
Example Request Body
{ "symbol": "symbol", "productType": "productType", "marginCoin": "marginCoin", "marginMode": "marginMode", "orderList": [ { "size": "size", "price": "price", "side": "side", "tradeSide": "tradeSide", "orderType": "orderType", "force": "force", "clientOid": "clientOid", "reduceOnly": "reduceOnly", "presetStopSurplusPrice": "presetStopSurplusPrice", "presetStopLossPrice": "presetStopLossPrice", "stpMode": "stpMode" } ] }
json
Example Responses
{ "code": "00000", "data": { "successList": [ { "orderId": "121211212122", "clientOid": "BITGET#121211212122" } ], "failureList": [], "result": true }, "msg": "success", "requestTime": 1627293504612 }
json
application/json

Modify Order

POST
https://api.bitget.com
/api/v2/mix/order/modify-order

Speed limit is 10 times/s for average users. Frequency limit imposed according to user ID

Interface for order modification, used to modify an pending order, such as its TP/SL and/or price/size.

Modifying size and price will cancel the old order; then create a new order asynchronously, modify the preset TPSL will not cancel the old order. Modifying size and price, please pass in both, not just one of them Modify the order price, size and preset TPSL according to orderId or clientOId It is only allowed to modify the new status limit order. If the size, price and TPSL all is set in the request, then the TPSL will not work Modify the limit order price and size, please be sure to provide newClientOid, because the orderId of the new order cannot be returned synchronously, so you need to use newClientOid to help you query order information Modifying the order size needs to meet the minimum order quantity If you only modify the TPSL, please do not pass price and size. If you only pass one of TP or SL, the other one will be cancelled

Modify Order › Request Parameters

symbol
​string · required

Trading pair, e.g. ETHUSDT

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures

newClientOid
​string · required

New customized order ID after order modification

orderId
​string

Order ID Either orderId or clientOid is required. If both are entered, orderId prevails.

clientOid
​string

Customize order ID Either orderId or clientOid is required. If both are entered, orderId prevails.

newSize
​string

Amount of the modified transaction The amount stays unchanged if the field if left blank.

newPrice
​string

Modified price for placing new orders.

  1. When the existing order type is Limit, the original price will be maintained if the field is left empty.
  2. When the existing order type is Limit market, the field should not be set.
newPresetStopSurplusPrice
​string

Modifying take-profit

  1. If the original order has take-profit set and the field is empty, the original value will be kept.
  2. If the original order has take-profit set and the field is filled in with a value, TP will be updated; if the original order has take-profit set and the field is not set, a new take-profit value will be added. If there was a TP value and a 0 is filled in the filled, the existing TP will be deleted.
newPresetStopLossPrice
​string

Modifying stop-loss

  1. If the original order has stop-loss set and the field is empty, the original value will be kept.
  2. If the original order has stop-loss set and the field is filled in with a value, TP will be updated; if the original order has stop-loss set and the field is not set, a new stop-loss value will be added. If there was a SL value and a 0 is filled in the filled, the existing SL will be deleted.

Modify Order › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
orderId
​string

Order ID

clientOid
​string

Customize order ID

POST/api/v2/mix/order/modify-order
curl https://api.bitget.com/api/v2/mix/order/modify-order \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "orderId": "orderId", "clientOid": "clientOid", "symbol": "symbol", "productType": "productType", "newClientOid": "newClientOid", "newSize": "newSize", "newPrice": "newPrice", "newPresetStopSurplusPrice": "newPresetStopSurplusPrice", "newPresetStopLossPrice": "newPresetStopLossPrice" }'
Example Request Body
{ "orderId": "orderId", "clientOid": "clientOid", "symbol": "symbol", "productType": "productType", "newClientOid": "newClientOid", "newSize": "newSize", "newPrice": "newPrice", "newPresetStopSurplusPrice": "newPresetStopSurplusPrice", "newPresetStopLossPrice": "newPresetStopLossPrice" }
json
Example Responses
{ "code": "00000", "data": { "orderId": "121212121212", "clientOid": "BITGET#121212121212" }, "msg": "success", "requestTime": 1627293504612 }
json
application/json

Cancel Order

POST
https://api.bitget.com
/api/v2/mix/order/cancel-order

Frequency limit: 10 times/1s

Cancel a pending order

Cancel Order › Request Parameters

symbol
​string · required

Trading pair

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures

marginCoin
​string

Margin coin must be capitalized

orderId
​string

Order ID Either orderId or clientOid is required. If both are present, orderId prevails.

clientOid
​string

Customize order ID Either orderId or clientOid is required. If both are present, orderId prevails.

Cancel Order › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
orderId
​string

Order ID

clientOid
​string

Client customized ID

POST/api/v2/mix/order/cancel-order
curl https://api.bitget.com/api/v2/mix/order/cancel-order \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "symbol": "symbol", "productType": "productType", "marginCoin": "marginCoin", "orderId": "orderId", "clientOid": "clientOid" }'
Example Request Body
{ "symbol": "symbol", "productType": "productType", "marginCoin": "marginCoin", "orderId": "orderId", "clientOid": "clientOid" }
json
Example Responses
{ "code": "00000", "data": { "orderId": "123", "clientOid": "" }, "msg": "success", "requestTime": 1627293504612 }
json
application/json

Batch Cancel

POST
https://api.bitget.com
/api/v2/mix/order/batch-cancel-orders

Speed limit is 10 times/s for average users. Frequency limit imposed according to user ID

Order cancelling interface, can be used to cancel by product type and trading pair.

Batch Cancel › Request Parameters

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures

​object[]

Order ID list.maximum length: 50 If filled in, symbol must not be null and must be aligned with symbol/productType.

symbol
​string

Trading pair, e.g. ETHUSDT It's required when orderIdList is set

marginCoin
​string

Margin coin must be capitalized

Batch Cancel › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
​object[]

The collection of successfully cancelled orders.

​object[]

The collection of unsuccessfully cancelled orders.

POST/api/v2/mix/order/batch-cancel-orders
curl https://api.bitget.com/api/v2/mix/order/batch-cancel-orders \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "orderIdList": [ { "orderId": "orderId", "clientOid": "clientOid" } ], "symbol": "symbol", "productType": "productType", "marginCoin": "marginCoin" }'
Example Request Body
{ "orderIdList": [ { "orderId": "orderId", "clientOid": "clientOid" } ], "symbol": "symbol", "productType": "productType", "marginCoin": "marginCoin" }
json
Example Responses
{ "code": "00000", "data": { "successList": [ { "orderId": "121211212122", "clientOid": "BITGET#121211212122" } ], "failureList": [ { "orderId": "232", "clientOid": "321342", "errorMsg": "notExistend", "errorCode": "43001" } ] }, "msg": "success", "requestTime": 1627293504612 }
json
application/json

Flash Close Position

POST
https://api.bitget.com
/api/v2/mix/order/close-positions

Frequency limit: 1 time/1s (User ID)

close position at market price

API Broker rebate identifier:

The following code block needs to be added to the HTTP Header of the request.

"X-CHANNEL-API-CODE":"your-channel-api-code"

Flash Close Position › Request Parameters

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures

symbol
​string

Trading pair

holdSide
​string

Position direction

  1. In one-way position mode(buy or sell): This field should be left blank. Will be ignored if filled in.
  2. In hedge-mode position(open or close): All positions will be closed if the field is left blank; Positions of the specified direction will be closed is the field is filled in. long: Long position; short: Short position

Flash Close Position › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
​object[]

The collection of successfully closed orders

​object[]

The collection of unsuccessfully closed orders The close order may fail when the pair is in delivery or in risk control handling

POST/api/v2/mix/order/close-positions
curl https://api.bitget.com/api/v2/mix/order/close-positions \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "symbol": "symbol", "holdSide": "holdSide", "productType": "productType" }'
Example Request Body
{ "symbol": "symbol", "holdSide": "holdSide", "productType": "productType" }
json
Example Responses
{ "code": "00000", "data": { "successList": [ { "orderId": "123", "clientOid": "xxxxx", "symbol": "BTCUSDT" } ], "failureList": [ { "orderId": "1234", "clientOid": "321", "symbol": "BTCUSDT", "errorMsg": "xxx", "errorCode": "xxxx" } ] }, "msg": "success", "requestTime": 1627293504612 }
json
application/json

Get Order Detail

GET
https://api.bitget.com
/api/v2/mix/order/detail

Frequency limit: 10 times/1s (uid)

Get order detail

Get Order Detail › Request Parameters

symbol
​string · required

Product ID must be capitalized

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures

orderId
​string

Order ID Either 'orderId' or 'clientOid' is required.

clientOid
​string

Custom order ID Either 'orderId' or 'clientOid' is required.

Get Order Detail › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
symbol
​string

Trading pair

size
​string

Amount

orderId
​string

Order ID

clientOid
​string

Customize order ID

baseVolume
​string

Amount of coins traded

priceAvg
​string

Average price

fee
​string

Transaction fee

price
​string

Order price

state
​string

Order status live: New order, waiting for a match in orderbook partially_filled: Partially filled filled: All filled canceled: the order is cancelled

side
​string

Direction buy sell

force
​string

Order expiration date ioc: Immediate or cancel fok: Fill or kill gtc: Good till canceled post only: post only orders

totalProfits
​string

Total PnL

posSide
​string

Position direction long: hedge mode long position short: hedge mode short position net: one-way position

marginCoin
​string

Margin coin

presetStopSurplusPrice
​string

Set TP

presetStopSurplusType
​string

Preset Take Profit Trigger type fill_price: market price; mark_price: mark price

presetStopSurplusExecutePrice
​string

Preset Take Profit Execution price

presetStopLossPrice
​string

Set SL

presetStopLossType
​string

Preset Stop Loss Trigger type fill_price: market price; mark_price: mark price

presetStopLossExecutePrice
​string

Preset Stop Loss Execution price

quoteVolume
​string

Trading amount in quoting coin

orderType
​string

Order type limit market

leverage
​string

Leverage

marginMode
​string

Margin mode isolated: isolated margin crossed: cross margin

reduceOnly
​string

Whether or not to just reduce the position. YES NO

enterPointSource
​string

Order source WEB: Orders created on the website API: Orders created on API SYS: System managed orders, usually generated by forced liquidation logic ANDROID: Orders created on the Android app IOS: Orders created on the iOS app

tradeSide
​string

Direction close: Close (open and close mode) open: Open (open and close mode) reduce_close_long: Liquidate partial long positions for hedge position mode reduce_close_short:Liquidate partial short positions for hedge position mode burst_close_long:Liquidate long positions for hedge position mode burst_close_short:Liquidate short positions for hedge position mode offset_close_long:Liquidate partial long positions for netting for hedge position mode offset_close_short:Liquidate partial short positions for netting for hedge position mode delivery_close_long:Delivery long positions for hedge position mode delivery_close_short:Delivery short positions for hedge position mode dte_sys_adl_close_long:ADL close long position for hedge position mode dte_sys_adl_close_short:ADL close short position for hedge position mode buy_single:Buy, one way postion mode sell_single:Sell, one way postion mode reduce_buy_single:Liquidate partial positions, buy, one way position mode reduce_sell_single:Liquidate partial positions, sell, one way position mode burst_buy_single:Liquidate short positions, buy, one way postion mode burst_sell_single:Liquidate partial positions, sell, one way position mode delivery_sell_single:Delivery sell, one way position mode delivery_buy_single:Delivery buy, one way position mode dte_sys_adl_buy_in_single_side_mode:ADL close position, buy, one way position mode dte_sys_adl_sell_in_single_side_mode:ADL close position, sell, one way position mode

newTradeSide
​string

Trade direction (new). Returned together with tradeSide for upgraded accounts; may be null for legacy orders

posMode
​string

Position mode one_way_mode: one-way position hedge_mode: two-way position

orderSource
​string

Order source normal: Normal order market: market order profit_market: Market TP order loss_market: Market SL order Trader_delegate: Elite trade order trader_profit: Trader takes profit trader_loss: Trader stops loss reverse: Reversed orders trader_reverse: Reversed elite trades profit_limit: Take-profit limit order loss_limit: Stop-loss limit order liquidation: Liquidation order delivery_close_long: close long positions delivery_close_short: close short positions pos_profit_limit: Position take-profit limit order pos_profit_market: Position take-profit market order pos_loss_limit: Position stop-loss limit order pos_loss_market: Position stop-loss market order profit_chase: Take Profit Chase Order loss_chase: Stop Loss Chase Order follower_delegate: Follower Delegate Order reduce_offset: Reduce Position Offset Order market_risk: Best Price Risk Handling plan_limit: Limit Plan Order plan_market: Best Price Plan Order pos_loss_limit: Position Stop Loss Limit strategy_positive: Strategy-Positive Grid strategy_reverse: Strategy-Reverse Grid strategy_unlimited: Unlimited Strategy move_limit: Limit Moving Take Profit and Stop Loss move_market: Best Price Moving Take Profit and Stop Loss tracking_limit: Limit Trailing Order tracking_market: Best Price Trailing Order strategy_dca_positive: DCA Strategy-Positive strategy_dca_reverse: DCA Strategy-Reverse strategy_oco_limit: Strategy-OCO Limit Order strategy_oco_trigger: Strategy-OCO Trigger Order modify_order_limit: Limit Modify Order strategy_regular_buy: Strategy-Regular Buy strategy_grid_middle: Strategy-Neutral Grid

cancelReason
​string

Cancel reason normal_cancel: Normal cancel stp_cancel: Cancelled by STP

cTime
​string

Creation time, ms

uTime
​string

Update time, ms

GET/api/v2/mix/order/detail
curl 'https://api.bitget.com/api/v2/mix/order/detail?symbol=<string>&productType=<string>'
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1695823012595, "data": { "symbol": "ethusdt", "size": "2", "orderId": "123456", "clientOid": "77777", "baseVolume": "2", "priceAvg": "1900", "fee": "", "price": "1900", "state": "filled", "side": "buy", "force": "gtc", "totalProfits": "2112", "posSide": "long", "marginCoin": "usdt", "presetStopSurplusPrice": "1910", "presetStopSurplusType": "fill_price", "presetStopSurplusExecutePrice": "1911", "presetStopLossPrice": "1890", "presetStopLossType": "fill_price", "presetStopLossExecutePrice": "1989", "quoteVolume": "1900", "orderType": "limit", "leverage": "20", "marginMode": "cross", "reduceOnly": "yes", "enterPointSource": "api", "tradeSide": "", "newTradeSide": null, "posMode": "one_way_mode", "orderSource": "normal", "cancelReason": "", "cTime": "1627300098776", "uTime": "1627300098776" } }
json
application/json

Get Order Fill Details

GET
https://api.bitget.com
/api/v2/mix/order/fills

Speed limit is 10 times/s for average users. Frequency limit imposed according to user ID

Get order fill details

Get Order Fill Details › Request Parameters

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures

orderId
​string

Order ID

symbol
​string

Trading pair, e.g. ETHUSDT

idLessThan
​string

Requests the content on the page before the tradeId (older data).

startTime
​string

Start time (time stamp in milliseconds) (The maximum time span supported is three months. The default end time is three months if no value is set for the end time. ) (For Managed Sub-Account, the StartTime cannot be earlier than the binding time)

endTime
​string

End time (time stamp in milliseconds) (The maximum time span supported is three months. The default start time is three months ago if no value is set for the start time. )

limit
​string

Number of queries: Default: 100, maximum: 100

Get Order Fill Details › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
​object[]

Transaction details

endId
​string

The final Transaction ID. This is used when idLessThan/idGreaterThan is set as a range.

GET/api/v2/mix/order/fills
curl 'https://api.bitget.com/api/v2/mix/order/fills?productType=<string>'
Example Responses
{ "code": "00000", "data": { "fillList": [ { "tradeId": "123", "symbol": "ethusdt", "orderId": "121212", "price": "1900", "baseVolume": "1", "feeDetail": [ { "deduction": "yes", "feeCoin": "BGB", "totalDeductionFee": "-0.017118519726", "totalFee": "-0.017118519726" } ], "side": "buy", "quoteVolume": "1902", "profit": "102", "enterPointSource": "api", "tradeSide": "close", "posMode": "hedge_mode", "tradeScope": "taker", "cTime": "1627293509612" } ], "endId": "123" }, "msg": "success", "requestTime": 1627293504612 }
json
application/json

Get Historical Transaction Details

GET
https://api.bitget.com
/api/v2/mix/order/fill-history

Frequency limit: 10 times/1s (uid)

Get order fill history

Get Historical Transaction Details › Request Parameters

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures It does not support to query the data in demo trading

orderId
​string

Order ID Either orderId or clientOid is required. If both are entered, orderId prevails.

symbol
​string

Trading pair, e.g. ETHUSDT

startTime
​string

Start timestamp Unix timestamp in milliseconds format, e.g. 1597026383085 (The maximum time span supported is a week. The default end time is a week if no value is set for the end time. ) (For Managed Sub-Account, the StartTime cannot be earlier than the binding time)

endTime
​string

End timestamp Unix timestamp in milliseconds format, e.g. 1597026383085 (The maximum time span supported is a week. The default start time is a week ago if no value is set for the start time. )

idLessThan
​string

Requests the content on the page before this ID (older data), the value input should be the endId of the corresponding interface.

limit
​string

Number of queries: Maximum: 100, default: 100

Get Historical Transaction Details › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
endId
​string

Last query ended order ID

​object[]

Order list

GET/api/v2/mix/order/fill-history
curl 'https://api.bitget.com/api/v2/mix/order/fill-history?productType=<string>'
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1699267238892, "data": { "fillList": [ { "tradeId": "xxxx", "symbol": "ETHUSDT", "marginCoin": "USDT", "orderId": "xxxx", "price": "1801.33", "baseVolume": "0.02", "feeDetail": [ { "deduction": "no", "feeCoin": "USDT", "totalDeductionFee": "0", "totalFee": "-0.02161596" } ], "side": "sell", "quoteVolume": "36.0266", "profit": "0.0252", "enterPointSource": "ios", "tradeSide": "sell_single", "posMode": "one_way_mode", "tradeScope": "taker", "cTime": "1698730804882" } ], "endId": "123456789" } }
json
application/json

Get Pending Orders

GET
https://api.bitget.com
/api/v2/mix/order/orders-pending

Rate limit: 10 req/sec/UID

To query all existing pending orders.

Get Pending Orders › Request Parameters

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures

orderId
​string

Order ID; If both orderId and clientOidare entered, orderId prevails.

clientOid
​string

Customize order ID; If both orderId and clientOid are entered, orderId prevails.

symbol
​string

Trading pair, e.g. ETHUSDT

status
​string

Order status If not specified, all ordered with a status of live (not filled yet) will be returned. live: pending orders partially_filled: Partially filled

idLessThan
​string

Requests the content on the page before this ID (older data), the value input should be the endId of the corresponding interface.

startTime
​string

Start timestamp Unix timestamp in milliseconds format, e.g. 1597026383085 (The maximum time span supported is three months. The default end time is three months if no value is set for the end time. )

endTime
​string

End timestamp Unix timestamp in milliseconds format, e.g. 1597026383085 (The maximum time span supported is three months. The default start time is three months ago if no value is set for the start time. )

limit
​string

Number of queries: Maximum: 100, default: 100

Get Pending Orders › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
​object[]

Order list

endId
​string

The final order ID. This is used when idLessThan/idGreaterThan is set as a range.

GET/api/v2/mix/order/orders-pending
curl 'https://api.bitget.com/api/v2/mix/order/orders-pending?productType=<string>'
Example Responses
{ "code": "00000", "data": { "entrustedList": [ { "symbol": "ethusdt", "size": "100", "orderId": "123", "clientOid": "12321", "baseVolume": "12.1", "fee": "", "price": "1900", "priceAvg": "1903", "status": "partially_filled", "side": "buy", "force": "gtc", "totalProfits": "0", "posSide": "long", "marginCoin": "usdt", "quoteVolume": "22001.21", "leverage": "20", "marginMode": "cross", "enterPointSource": "api", "tradeSide": "open", "posMode": "hedge_mode", "orderType": "limit", "orderSource": "normal", "cTime": "1627293504612", "uTime": "1627293505612", "presetStopSurplusPrice": "2001", "presetStopSurplusTriggerType": "mark_price", "presetStopSurplusExecutePrice": "2201", "presetStopLossPrice": "1800", "presetStopLossTriggerType": "mark_price", "presetStopLossExecutePrice": "1900" } ], "endId": "123" }, "msg": "success", "requestTime": 1627293504612 }
json
application/json

Get History Order

GET
https://api.bitget.com
/api/v2/mix/order/orders-history

Rate limit: 10 req/sec/UID

Get history order(It only supports to get the data within 90days. The older data can be downloaded from web)

Get History Order › Request Parameters

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures

orderId
​string

Order ID If both orderId and clientOid are entered, orderId prevails.

clientOid
​string

Customize order ID If both orderId and clientOid are entered, orderId prevails.

symbol
​string

Trading pair, e.g. ETHUSDT

idLessThan
​string

Requests the content on the page before this ID (older data), the value input should be the endId of the previous request response

orderSource
​string

Order sources normal: Normal order market: market order profit_market: Market TP order loss_market: Market SL order Trader_delegate: Elite trade order trader_profit: Trader takes profit trader_loss: Trader stops loss reverse: Reversed orders trader_reverse: Reversed elite trades profit_limit: Take-profit limit order loss_limit: Stop-loss limit order liquidation: Liquidation order delivery_close_long: close long positions delivery_close_short: close short positions pos_profit_limit: Position take-profit limit order pos_profit_market: Position take-profit market order pos_loss_limit: Position stop-loss limit order pos_loss_market: Position stop-loss market order

startTime
​string

Start timestamp Unix timestamp in milliseconds format, e.g. 1597026383085 (For Managed Sub-Account, the StartTime cannot be earlier than the binding time)

endTime
​string

End timestamp Unix timestamp in milliseconds format, e.g. 1597026383085

limit
​string

Number of queries: Maximum: 100, default: 100

Get History Order › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
endId
​string

Last query ended order ID

​object[]

Order list

GET/api/v2/mix/order/orders-history
curl 'https://api.bitget.com/api/v2/mix/order/orders-history?productType=<string>'
Example Responses
{ "code": "00000", "data": { "entrustedList": [ { "symbol": "ethusdt", "size": "100", "orderId": "123", "clientOid": "12321", "baseVolume": "12.1", "fee": "-0.00854", "price": "1900", "priceAvg": "1903", "status": "filled", "side": "buy", "force": "gtc", "totalProfits": "0", "posSide": "long", "marginCoin": "usdt", "quoteVolume": "22001.21", "leverage": "20", "marginMode": "crossed", "reduceOnly": "NO", "enterPointSource": "api", "tradeSide": "open", "posMode": "hedge_mode", "posAvg": "", "orderType": "limit", "orderSource": "normal", "liqPrice": "", "cTime": "1627293504612", "uTime": "1627293505612", "presetStopSurplusPrice": "2001", "presetStopLossPrice": "1800" } ], "endId": "123" }, "msg": "success", "requestTime": 1627293504612 }
json
application/json

Cancel All Orders

POST
https://api.bitget.com
/api/v2/mix/order/cancel-all-orders

Rate limit: 10 req/sec/UID

Cancel All Orders › Request Parameters

productType
​string · required

Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures

marginCoin
​string

Margin coin, must be capitalized

requestTime
​string

request Time Unix millisecond timestamp

receiveWindow
​string

valid window period Unix millisecond timestamp Unix millisecond timestamp

Cancel All Orders › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
​object[]

The collection of successfully cancelled orders.

​object[]

The collection of unsuccessfully cancelled orders.

POST/api/v2/mix/order/cancel-all-orders
curl https://api.bitget.com/api/v2/mix/order/cancel-all-orders \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "productType": "productType", "marginCoin": "marginCoin", "requestTime": "requestTime", "receiveWindow": "receiveWindow" }'
Example Request Body
{ "productType": "productType", "marginCoin": "marginCoin", "requestTime": "requestTime", "receiveWindow": "receiveWindow" }
json
Example Responses
{ "code": "00000", "data": { "successList": [ { "orderId": "121211212122", "clientOid": "BITGET#121211212122" } ], "failureList": [ { "orderId": "232", "clientOid": "321342", "errorMsg": "notExistend" } ] }, "msg": "success", "requestTime": 1627293504612 }
json
application/json