Trading
Add orders (batch)
Creates up to 20 orders in one message.
WSS
wss://ws.bit2me.com/v1/tradingadd-ordersOrders are accepted or rejected one by one: check both ordersCreated and
ordersFailedReasons in the reply.
Batch order creation request.
event*string
Value
add-ordersorders*object[]
Items
1 <= items <= 20Show propertiesHide properties
symbol*string
Market symbol as BASE/QUOTE, uppercase. The list of valid symbols is GET /v2/trading/market-config.
Match
^[A-Z0-9]+/[A-Z0-9]+$Example
B2M/EURside*string
buy spends the quote currency to get the base currency; sell does the opposite.
Value in
buy | selltype*string
limit: rests in the book atpriceor better.market: executes immediately against the book at the best available prices.stop-limit: staysinactiveuntil the market reachesstopPrice, then becomes a limit order atprice.
Value in
limit | market | stop-limitamount*string
Order size, in the base currency unless amountInQuote is true.
Match
^[0-9]+(\.[0-9]+)?$price?string
Only for limit and stop-limit.
Match
^[0-9]+(\.[0-9]+)?$stopPrice?string
Only for stop-limit.
Match
^[0-9]+(\.[0-9]+)?$clientOrderId?string
Length
length <= 48postOnly?boolean
timeInForce?string
GTC(good 'til cancelled), the default: rests in the book until filled or cancelled.FOK(fill or kill): executes completely and immediately, or is cancelled. Only forlimitorders.IOC(immediate or cancel): not available on Bit2Me markets.
Value in
GTC | IOC | FOKDefault
GTCamountInQuote?boolean
amount is in the quote currency. Only for market orders.
{ "event": "add-orders", "orders": [ { "side": "buy", "symbol": "B2M/EUR", "price": "0.001", "stopPrice": "0", "amount": "1000", "type": "limit", "clientOrderId": "my-bot-order-0001" }, { "side": "sell", "symbol": "B2M/EUR", "price": "0.5", "stopPrice": "0", "amount": "1000", "type": "limit", "clientOrderId": "my-bot-order-0002" } ]}{ "event": "added-orders", "data": { "userId": "7bd4cc22-7682-4e45-85b3-29386b979d75", "ordersCreated": [], "ordersFailedReasons": [ { "symbol": "B2M/EUR", "clientOrderId": "my-bot-order-0003", "error": { "code": "PRICE_LOWER_MARKET_MIN", "minPrice": 0.001, "message": "The price can not be lower than 0.001" } } ] }}