Bitget APIBitget API
UTAClassic
Legacy Doc
  • Overview
  • API Documentation
  • WebSocket
  • Agent Hub
  • SDK
  • Changelog
Copied to clipboard
Websocket
Introduction
Futures
Spot
    Public
    Private
      Account ChannelFill ChannelOrder ChannelTrigger Order ChannelPlace Order ChannelCancel Order Channel
Margin
Private

Place Order Channel

Description

1.Rate limit will be shared with Rest API
2.Please connect to V2 Websocket domain: wss://ws.bitget.com/v2/ws/private
3.So far websocket trading doesn't support placing batch orders

Code
{ "op":"trade", "args":[ { "id":"xxxxx-xxx-xxx-xxxx-xxxxxx", "instType":"SPOT", "instId":"BTCUSDT", "channel":"place-order", "params":{ "orderType":"limit", "side":"buy", "size":"1", "price":"252", "force":"gtc", "clientOid":"xxxxx-xxx-xxx-xxxx-xxxxxx" } } ] }

Request Parameters

ParameterTypeRequiredDescription
opStringYes"trade"
apiCodeStringNoAPI rebate identifier
argsList<Object>YesList of channels to request subscription
> idStringYesUnique Identifier
Length<= 40
("^[0-9A-Za-z_:#\-+\s]*$");
> instTypeStringYesProduct line type SPOT
> instIdStringYesProduct ID, e.g. ETHUSDT
> channelStringYesChannel name, place-order
> paramsObjectYes
>> orderTypeStringYesOrder type
limit: Limit order
market: Market order
>> sideStringYesOrder Direction
buy: Buy
sell: Sell
>> sizeStringYesAmount
For Limit and Market-Sell orders, it represents the number of base coins.
For Market-Buy orders, it represents the number of quote coins.
The decimal places of amount can be got trough Get Symbol Info interface
>> forceStringYesExecution strategy(It will be invalid when orderType is market)
gtc:Normal limit order, good till cancelled
post_only:Post only
fok:Fill or kill
ioc:Immediate or cancel
>> priceStringNoLimit price
The decimal places of price and the price step can be returned by the Get Symbol Info interface
>> clientOidStringNoCustom order ID.
>> stpModeStringNoSTP Mode(Self Trade Prevention)
none:not setting STP(default)
cancel_taker:cancel taker order
cancel_maker:cancel maker order
cancel_both:cancel both of taker and maker orders
Code
{ "event":"trade", "arg":[ { "id":"xxxxx-xxx-xxx-xxxx-xxxxxx", "instType":"SPOT", "channel":"place-order", "instId":"BTCUSDT", "params":{ "orderId":"xxxxxxxx", "clientOid":"xxxxx-xxx-xxx-xxxx-xxxxxx" } } ], "code":0, "msg":"Success" }

Response Parameters

ParameterTypeDescription
eventStringEvent
trade
error
argObjectChannel
> idStringUnique Identifier
Length<= 40
("^[0-9A-Za-z_:#\-+\s]*$");
> instTypeStringProduct line type SPOT
> instIdStringProduct ID, e.g. ETHUSDT
> channelStringChannel name, place-order
> paramsObject
>> orderIdStringOrder ID.
>> orderTypeStringOrder type
limit: Limit order
market: Market order
>> sideStringOrder Direction
buy: Buy
sell: Sell
>> sizeStringAmount
For Limit and Market-Sell orders, it represents the number of base coins.
For Market-Buy orders, it represents the number of quote coins.
The decimal places of amount can be got trough Get Symbol Info interface
>> forceStringExecution strategy(It will be invalid when orderType is market)
gtc:Normal limit order, good till cancelled
post_only:Post only
fok:Fill or kill
ioc:Immediate or cancel
>> priceStringLimit price
The decimal places of price and the price step can be returned by the Get Symbol Info interface
>> clientOidStringCustom order ID.
>> stpModeStringSTP Mode(Self Trade Prevention)
none:not setting STP(default)
cancel_taker:cancel taker order
cancel_maker:cancel maker order
cancel_both:cancel both of taker and maker orders
codeStringcode
msgStringmsg
Trigger Order ChannelCancel Order Channel
JSON
JSON