Trading

Add orders (batch)

Creates up to 20 orders in one message.

WSSwss://ws.bit2me.com/v1/tradingadd-orders

Orders are accepted or rejected one by one: check both ordersCreated and ordersFailedReasons in the reply.

Batch order creation request.

event*string
Valueadd-orders
orders*object[]
Items1 <= items <= 20
Show 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]+$
ExampleB2M/EUR
side*string

buy spends the quote currency to get the base currency; sell does the opposite.

Value inbuy | sell
type*string
  • limit: rests in the book at price or better.
  • market: executes immediately against the book at the best available prices.
  • stop-limit: stays inactive until the market reaches stopPrice, then becomes a limit order at price.
Value inlimit | market | stop-limit
amount*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
Lengthlength <= 48
postOnly?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 for limit orders.
  • IOC (immediate or cancel): not available on Bit2Me markets.
Value inGTC | IOC | FOK
DefaultGTC
amountInQuote?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"        }      }    ]  }}